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

Agent cannot compile catalog if it specifies an non-existent environment in puppet.conf even when the classifier is controlling environment

    XMLWordPrintable

Details

    • Major
    • 4 - 50-90% of Customers
    • 3 - Serious
    • 4 - $$$$$
    • Similar impact as PUP-6739
    • Bug Fix
    • Fixes a bug that caused the agent run to fail if the agent requested an environment that didn't exist on the server, even when the classifier was controlling the environment.

    Description

      The Problem

      [root@agent201621-centos ~]# puppet agent -t 
      Info: Using configured environment 'production'
      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Info: Loading facts
      Info: Caching catalog for agent201621-centos
      Info: Applying configuration version '1475855527'
      Notice: Applied catalog in 0.40 seconds
       
      [root@agent201621-centos ~]# puppet config set environment fake --section agent
       
      [root@agent201621-centos ~]# puppet agent -t
      Warning: Unable to fetch my node definition, but the agent run will continue:
      Warning: Error 400 on SERVER: Could not find environment 'fake'
      Info: Retrieving pluginfacts
      Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Failed to generate additional resources using 'eval_generate': Error 400 on SERVER: Could not find environment 'fake'
      Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Could not evaluate: Could not retrieve file metadata for puppet:///pluginfacts: Error 400 on SERVER: Could not find environment 'fake'
      Info: Retrieving plugin
      Error: /File[/opt/puppetlabs/puppet/cache/lib]: Failed to generate additional resources using 'eval_generate': Error 400 on SERVER: Could not find environment 'fake'
      Error: /File[/opt/puppetlabs/puppet/cache/lib]: Could not evaluate: Could not retrieve file metadata for puppet:///plugins: Error 400 on SERVER: Could not find environment 'fake'
      Info: Loading facts
      Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find environment 'fake'
      Warning: Not using cache on failed catalog
      Error: Could not retrieve catalog; skipping run
      Error: Could not send report: Error 400 on SERVER: Could not find environment 'fake'
      

      Now if I go ahead and make the environment on the master, it'll compile the catalog against the production environment as expected.

      On the master:

      [root@master201621-centos ~]# cp -r /etc/puppetlabs/code/environments/production/ /etc/puppetlabs/code/environments/fake
      

      Now on the agent:

      [root@agent201621-centos ~]# puppet agent -t
      Notice: Local environment: 'fake' doesn't match server specified node environment 'production', switching agent to 'production'.
      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Info: Loading facts
      Info: Caching catalog for agent201621-centos
      Info: Applying configuration version '1475855805'
      Notice: Applied catalog in 0.36 seconds
      

      Expected Behavior

      The existence of the environment that the agent sets in puppet.conf should not matter if the ENC is controlling the environment. I expect this message in both cases.

      Notice: Local environment: 'fake' doesn't match server specified node environment 'production', switching agent to 'production'.
      

      Attachments

        Issue Links

          Activity

            People

              dorin.pleava Dorin Pleava
              nick.walker Nick Walker
              Votes:
              1 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support