Jira (PUP-10216) Failure to fetch node definition may result in bad pluginsync and cascading failure

2 views
Skip to first unread message

Reid Vandewiele (JIRA)

unread,
Jan 3, 2020, 5:12:03 PM1/3/20
to puppe...@googlegroups.com
Reid Vandewiele created an issue
 
Puppet / Bug PUP-10216
Failure to fetch node definition may result in bad pluginsync and cascading failure
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2020/01/03 2:11 PM
Priority: Normal Normal
Reporter: Reid Vandewiele

Puppet Version: all

Early on in the agent run process, Puppet calls an indirector to choose an environment to pluginsync against. If anything goes wrong with that call, pretty much anything at all, Puppet will pluginsync against the agent-configured environment (usually "production") and spit out a warning.

Warning: Unable to fetch my node definition, but the agent run will continue

 

Desired Behavior:

Puppet should pluginsync against the last-used environment, or alternatively, fail fast. At customer sites where "production" is not used, pluginsyncing against what is probably an empty environment has been observed to add ten minutes+ of time to a Puppet agent run, as it first deletes all of its plugins, and then has to re-sync them fresh from the correct environment after it switches over. This can negatively affect the delivery of changes that need to be performed within a change control window.

Actual Behavior:

Puppet pluginsyncs against production, or the environment value set with --environment or in puppet.conf.

 

Reproduction:

  • Create an environment "r1" and "production"
  • Pin a test agent to "r1"
  • Edit /etc/puppetlabs/puppetserver/conf.d/auth.conf to disallow the test agent from requesting the /puppet/v3/node path
  • Run puppet agent -t on the test agent

The agent will produce the expected error, pluginsync against production, retrieve a catalog, switch to r1, pluginsync against r1, retrieve a catalog, and apply it.

The kind of problem this can cause may be made clearly evident if you supply a fact in environment r1 that is needed to compile an r1 catalog. See below.

[root@pe-xl-compiler-2 ~]# puppet agent -t
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: Error 403 on SERVER: Forbidden request: /puppet/v3/node/pe-xl-compiler-2.dev36.puppet.vm (method :get). Please see the server logs for details.
Info: Retrieving pluginfacts
Notice: /File[/opt/puppetlabs/puppet/cache/facts.d/r1.txt]/ensure: removed
Info: Retrieving plugin
Info: Retrieving locales
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Fact r1_fact does not exist! (file: /etc/puppetlabs/code/environments/r1/manifests/site.pp, line: 29, column: 5) on node pe-xl-compiler-2.dev36.puppet.vm
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Specifying r1 with the environment flag mitigates the issue, and demonstrates what a better behavior might look like when this problem occurs.

[root@pe-xl-compiler-2 ~]# puppet agent -t --environment=r1
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: Error 403 on SERVER: Forbidden request: /puppet/v3/node/pe-xl-compiler-2.dev36.puppet.vm (method :get). Please see the server logs for details.
Info: Retrieving pluginfacts
Notice: /File[/opt/puppetlabs/puppet/cache/facts.d/r1.txt]/ensure: defined content as '{md5}13b8114b76258d0104dd0568b031361d'
Info: Retrieving plugin
Info: Retrieving locales
Info: Loading facts
Info: Caching catalog for pe-xl-compiler-2.dev36.puppet.vm
Info: Applying configuration version 'pe-xl-core-0-r1-bb4c21dbce5'
Notice: Applied catalog in 14.23 seconds  

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Reid Vandewiele (JIRA)

unread,
Jan 3, 2020, 5:13:03 PM1/3/20
to puppe...@googlegroups.com
Reid Vandewiele updated an issue
Change By: Reid Vandewiele
Method Found: Needs Assessment Customer Feedback

Austin Boyd (JIRA)

unread,
Jan 3, 2020, 5:49:04 PM1/3/20
to puppe...@googlegroups.com
Austin Boyd updated an issue
Change By: Austin Boyd
Zendesk Ticket IDs: 37556
Zendesk Ticket Count: 1

Austin Boyd (JIRA)

unread,
Jan 3, 2020, 5:49:05 PM1/3/20
to puppe...@googlegroups.com

Jorie Tappa (JIRA)

unread,
Jan 6, 2020, 1:09:03 PM1/6/20
to puppe...@googlegroups.com
Jorie Tappa commented on Bug PUP-10216
 
Re: Failure to fetch node definition may result in bad pluginsync and cascading failure

Using last-run info seems like the preferred route for this

Jorie Tappa (JIRA)

unread,
Jan 6, 2020, 1:09:04 PM1/6/20
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Jan 9, 2020, 12:06:03 PM1/9/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-10216
 
Re: Failure to fetch node definition may result in bad pluginsync and cascading failure

It would be possible to read the environment from the Puppet[:lastrunreport], but it would probably be better performance-wise to add the environment to the Puppet[:lastrunfile summary, and read that in instead.

Josh Cooper (Jira)

unread,
Jun 5, 2020, 7:39:03 PM6/5/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Change By: Josh Cooper
Epic Link: PUP-10539
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Ciprian Badescu (Jira)

unread,
Jun 16, 2021, 5:18:01 AM6/16/21
to puppe...@googlegroups.com
Ciprian Badescu updated an issue
Change By: Ciprian Badescu
Story Points: 3
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Gabriel Nagy (Jira)

unread,
Jun 23, 2021, 8:47:01 AM6/23/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Jun 30, 2021, 5:07:02 AM6/30/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jul 2, 2021, 12:32:13 PM7/2/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 7.9.0
Fix Version/s: PUP 6.24.0

Josh Cooper (Jira)

unread,
Jul 2, 2021, 6:14:03 PM7/2/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Jul 6, 2021, 6:27:03 AM7/6/21
to puppe...@googlegroups.com
Ciprian Badescu updated an issue
 
Change By: Ciprian Badescu
Fix Version/s: PUP 7.9.0
Fix Version/s: PUP 6.24.0

Gabriel Nagy (Jira)

unread,
Jul 6, 2021, 6:29:03 AM7/6/21
to puppe...@googlegroups.com
Gabriel Nagy commented on Bug PUP-10216
 
Re: Failure to fetch node definition may result in bad pluginsync and cascading failure

Opened a revert PR https://github.com/puppetlabs/puppet/pull/8679

See the description for more context, in short it'd be good to get PUP-6802 and PUP-9570 in prior to this, so we minimize possible breakage.

Josh Cooper (Jira)

unread,
Jul 7, 2021, 7:27:03 PM7/7/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Change By: Josh Cooper
Fix Version/s: PUP 7.10
Fix Version/s: PUP 7.10.0

Josh Cooper (Jira)

unread,
Jul 7, 2021, 7:27:03 PM7/7/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 6.25.0
Fix Version/s: PUP 7.10

Ciprian Badescu (Jira)

unread,
Jul 14, 2021, 4:49:04 AM7/14/21
to puppe...@googlegroups.com
Ciprian Badescu updated an issue
Change By: Ciprian Badescu
Sprint: NW-2021-06-30, NW-2021-07-14 , NW-2021-07-28

Gabriel Nagy (Jira)

unread,
Jul 27, 2021, 10:38:03 AM7/27/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Jul 28, 2021, 5:23:02 AM7/28/21
to puppe...@googlegroups.com
Ciprian Badescu updated an issue
Change By: Ciprian Badescu
Sprint: NW-2021-06-30, NW-2021-07-14, NW-2021-07-28 , NW-2021-08-11

Josh Cooper (Jira)

unread,
Jul 30, 2021, 2:21:04 PM7/30/21
to puppe...@googlegroups.com

Gabriel Nagy (Jira)

unread,
Aug 4, 2021, 12:59:03 AM8/4/21
to puppe...@googlegroups.com
Gabriel Nagy updated an issue
 
Change By: Gabriel Nagy
Release Notes: Enhancement
Release Notes Summary: Previously, Puppet agents would make a node definition request to the server in order to find out the correct environment to run in. This request has now been removed, and the agent now saves its last used environment in the `last_run_summary.yaml` file. If the environment is not specifically set via CLI or config, agents will attempt to use the environment in `last_run_summary.yaml`.

Claire Cadman (Jira)

unread,
Aug 11, 2021, 9:13:02 AM8/11/21
to puppe...@googlegroups.com

Austin Boyd (Jira)

unread,
Jan 17, 2022, 8:43:02 PM1/17/22
to puppe...@googlegroups.com
Austin Boyd updated an issue
Change By: Austin Boyd
Zendesk Ticket Count: 1 2
Zendesk Ticket IDs: 37556 ,47030
This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages