| 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. |