Ask Your Question

Puppet Config Print <attribute> Fails When Environment Directory 'Does Not Exist' on Agent Node

asked 2016-11-20 04:17:52 -0500

Nathan Stone gravatar image

Hi All,

I have 2 environments on my puppetserver, production and test.

I have updated the puppet agent to use the environment named test, running puppet agent works, however I see an error when I try use puppet config print commands due to the fact there is no directory in the environment path on the agent node.

Please can you advise me what might be wrong?

Kind Regards, Nath

[sysadmin@centos ~]$ sudo puppet agent -t

Info: Using configured environment 'test' Info: Retrieving pluginfacts Info: Retrieving plugin Info: Caching catalog for Info: Applying configuration version '8089cb3fe0610ba8f3e7d76129094548225b311f' Notice: Applied catalog in 0.17 seconds

[sysadmin@centos ~]$

[sysadmin@centos ~]$ cat /etc/puppetlabs/puppet/puppet.conf

server =

environment = test

[sysadmin@centos ~]$

[sysadmin@centos ~]$ sudo puppet config print environment

/opt/puppetlabs/puppet/lib/ruby/vendorruby/puppet/environments.rb:38:in get!': Could not find a directory environment named 'test' anywhere in the path: /etc/puppetlabs/code/environments. Does the directory exist? (Puppet::Environments::EnvironmentNotFound) from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application_support.rb:29:inpushapplicationcontext' from /opt/puppetlabs/puppet/lib/ruby/vendorruby/puppet/application.rb:337:in run' from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:inrun' from /opt/puppetlabs/puppet/lib/ruby/vendorruby/puppet/util/commandline.rb:72:in execute' from /opt/puppetlabs/bin/puppet:5:in<main>' [sysadmin@centos ~]$

If I do:

sudo mkdir /etc/puppetlabs/code/environments/test

Then the error goes away

I'm not sure why

a) I need the directory to exist on the agent node

b) If I need the directory to exist, why it isn't there

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2017-01-31 07:46:40 -0500

Nathan Stone gravatar image

Turns out this is a bug that was recently logged and is being worked.

edit flag offensive delete link more

answered 2016-11-21 05:59:59 -0500

you dont need the directory to exist on the agent node -- do you have environment set locally in puppet.conf? if its being set via puppetdb etc that may cause the config print etc to fail on client - but shoudnt be important..

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2016-11-20 04:08:38 -0500

Seen: 204 times

Last updated: Jan 31