Jira (PUP-10682) Puppet run fails when directory for requested env doesn't exist, even if the ENC enforces some other env

4 views
Skip to first unread message

Andreas Zuber (Jira)

unread,
Sep 30, 2020, 9:08:05 AM9/30/20
to puppe...@googlegroups.com
Andreas Zuber created an issue
 
Puppet / Bug PUP-10682
Puppet run fails when directory for requested env doesn't exist, even if the ENC enforces some other env
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2020/09/30 6:07 AM
Priority: Normal Normal
Reporter: Andreas Zuber

Puppet Version: 6.18.0
Puppet Server Version: 6.13.0
OS Name/Version: SLES 12

If the agent requests an environment, even if the ENC enforces something different and the directory for that requested environment doesn't exist, the run will fail

Desired Behavior:

puppet agent --test --environment blaNotice: Local environment: 'bla' doesn't match server specified node environment 'dev', switching agent to 'dev'.

Actual Behavior:

puppet agent --test --environment bla
Warning: Unable to fetch my node definition, but the agent run will continue:Warning: Find /puppet/v3/node/mynode.example.com resulted in 404 with the message: {"message":"Not Found: Could not find environment 'bla'","issue_kind":"RUNTIME_ERROR"}

This can be worked around with by simply creating an empty directory on the puppet node:

/etc/puppetlabs/code/environments # mkdir bla

puppet agent --test --environment bla
Notice: Local environment: 'bla' doesn't match server specified node environment 'dev', switching agent to 'dev'.

We encountered this issue because we where decommissioning some old environments.

Since puppet agent will always request the default "production" environment and then write the "Local environment: 'production' doesn't match... " we wrote the actual env to the puppet.conf with puppet to reduce the noise.

Now if we remove that environment the puppet agents will still request it and the run will fail because of the missing directory, even thouhg the ENC actually enforces another environment.

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Josh Cooper (Jira)

unread,
Sep 30, 2020, 1:19:03 PM9/30/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
*Puppet Version: 6.18.0*
*Puppet Server Version: 6.13.0*
*OS Name/Version: SLES 12*


If the agent requests an environment, even if the ENC enforces something different and the directory for that requested environment doesn't exist, the run will fail

*Desired Behavior:*
{code:java}
puppet agent --test --environment
blaNotice bla
Notice
: Local environment: 'bla' doesn't match server specified node environment 'dev', switching agent to 'dev'.
{code}
*Actual Behavior:*
{code:java}

puppet agent --test --environment bla
Warning: Unable to fetch my node definition, but the agent run will continue:Warning: Find /puppet/v3/node/mynode.example.com resulted in 404 with the message: {"message":"Not Found: Could not find environment 'bla'","issue_kind":"RUNTIME_ERROR"}
{code}

This can be worked around with by simply creating an empty directory on the puppet node:
{code:java}
/etc/puppetlabs/code/environments # mkdir bla{code}
{code:java}

puppet agent --test --environment bla
Notice: Local environment: 'bla' doesn't match server specified node environment 'dev', switching agent to 'dev'.
{code}

We encountered this issue because we where decommissioning some old environments.

Since puppet agent will always request the default "production" environment and then write the "Local environment: 'production' doesn't match... " we wrote the actual env to the puppet.conf with puppet to reduce the noise.

Now if we remove that environment the puppet agents will still request it and the run will fail because of the missing directory, even thouhg the ENC actually enforces another environment.

 

Josh Cooper (Jira)

unread,
Sep 30, 2020, 1:20:04 PM9/30/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
*Puppet Version: 6.18.0*
*Puppet Server Version: 6.13.0*
*OS Name/Version: SLES 12*

If the agent requests an environment, even if the ENC enforces something different and the directory for that requested environment doesn't exist, the run will fail

*Desired Behavior:*
{code:java}
puppet agent --test --environment bla

Notice: Local environment: 'bla' doesn't match server specified node environment 'dev', switching agent to 'dev'.
{code}
*Actual Behavior:*
{code:java}
puppet agent --test --environment bla
Warning: Unable to fetch my node definition, but the agent run will continue
:
Warning: Find /puppet/v3/node/mynode.example.com resulted in 404 with the message: {"message":"Not Found: Could not find environment 'bla'","issue_kind":"RUNTIME_ERROR"}
{code}
This can be worked around with by simply creating an empty directory on the puppet node:
{code:java}
/etc/puppetlabs/code/environments # mkdir bla{code}
{code:java}
puppet agent --test --environment bla
Notice: Local environment: 'bla' doesn't match server specified node environment 'dev', switching agent to 'dev'.
{code}
We encountered this issue because we where decommissioning some old environments.

Since puppet agent will always request the default "production" environment and then write the "Local environment: 'production' doesn't match... " we wrote the actual env to the puppet.conf with puppet to reduce the noise.

Now if we remove that environment the puppet agents will still request it and the run will fail because of the missing directory, even thouhg the ENC actually enforces another environment.

 

Josh Cooper (Jira)

unread,
Sep 30, 2020, 1:26:03 PM9/30/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-10682
 
Re: Puppet run fails when directory for requested env doesn't exist, even if the ENC enforces some other env

This is a dup of PUP-6802. See my comment in https://tickets.puppetlabs.com/browse/PUP-6802?focusedCommentId=729538&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-729538 specifically. The problem is the agent must specify the name of a valid environment that exists on the server in order to ask the server which environment the agent belongs in. If the environment is deleted from the server, then it will "orphan" agents that are pinned to that environment in puppet.conf.

Reply all
Reply to author
Forward
0 new messages