Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-3489

$confdir/environments/production is cached on startup even if not in configured environmentpath


    • Type: Bug
    • Status: Accepted
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: PUP 3.7.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:


      I have a directory environment named `production` in the default environmentpath of `/etc/puppetlabs/puppet/environments`. This directory environment does not contain any modules, and its manifest contains only the filebucket & File configuration required by PE, and an empty default node block.

      In the `puppet.conf`, I have configured the `environmentpath` to point to a temporary directory that contains two environments named `production` and `testing`. Both of these environments define an `echo_environment` class that simply echos the current environment. I have my ENC configured to place all nodes into a group with an agent-specified environment and assigns them this `echo_environment` class.

      When I start the master and then run `puppet agent -t`, the agent run fails with an error that states the `echo_environment` class could not be found. If I specify the environment to be `testing` on the command line, then the run succeeds and the notify from the `echo_environment` class is visible. If I wait a few minutes for the production environment to be evicted from the environment cache, and then run `puppet agent -t` again, this time the class is found and the run succeeds.

      It seems that the production environment in the default `environmentpath` is loaded when the master starts up, before the configured `environmentpath` is read from puppet.conf, and placed in the environment cache, even though it is not the correct `production` environment, given that the run fails at first but succeeds after waiting a few minutes for the cache to become stale. This is reinforced by the observation that when the `environment_timeout` is set to 0, then the run will always succeed.




            • Assignee:
              dan.lidral-porter Dan Lidral-Porter
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created:

                Zendesk Support