Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
PUP 4.7.0
-
None
-
- `puppet config` does not fail when an environment is set on an agent.
- Acceptance tests written
-
Platform Core
-
5
-
Platform Core KANBAN
-
Major
-
4 - 50-90% of Customers
-
3 - Serious
-
4 - $$$$$
-
While this issue isn't difficult for an experienced user to work around. For many new or non-english reading users the error may not be easily understood and breaks CLI usage of puppet on the node.
-
Bug Fix
-
-
Manual
Description
If no matching local $environment folder on agent, error when running any 'puppet config' or 'puppet module' command.
See REPROs in comments below.
For example, if you have an environment called 'dev' on the master, and you want to set an agent's $environment from the default of 'production' to 'dev', you might issue a puppet config set environment dev comand. When run, puppet config will look up the current environment ('production' at this point) and ensure there is a corresponding 'production' folder in the environments path. Assume this succeeds because a 'production' folder exists locally on the agent, by default, but NO OTHER environment folders exist locally on the agent (and shouldn't need to exist in my view).
Now the environment is set to 'dev'.
If a user issues any puppet config command at this point, the current environment ('dev' at this point) will NOT have a corresponding environment folder, so we get an error like:
Could not find a directory environment named 'dev' anywhere in the path: /etc/puppetlabs/code/environments. Does the directory exist?
|
[root@pup-vra7-0403 ~]# puppet config set environment production
|
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/environments.rb:38:in `get!': Could not find a directory environment named 'dev' 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:in `push_application_context'
|
from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:337:in `run'
|
from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in `run'
|
from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in `execute'
|
from /usr/local/bin/puppet:5:in `<main>'
|
This means we're stuck and cannot issue any puppet config print or puppet config set commands even to get us back to an environment setting of 'production'!
Attachments
Issue Links
- causes
-
MODULES-8821 puppet_agent installer not upgrading windows nodes when in a non-production environment
-
- Resolved
-
- duplicates
-
ENTERPRISE-904 Cannot install non-production environment on new client
-
- Closed
-
- is duplicated by
-
PUP-5931 puppet config print does not work if you are not the master
-
- Closed
-
-
PUP-6048 error running puppet with non existing and non default environment
-
- Closed
-
-
PUP-7628 Cannot run puppet commands or startup master when environment directory missing
-
- Closed
-
-
PUP-7900 Can't set agent env back to production with CLI
-
- Closed
-
- relates to
-
PUP-8419 Agent's node request fails if environment directory doesn't exist locally
-
- Closed
-
-
PUP-10796 puppet filebucket fails when using non-default environment from master
-
- Closed
-
-
PUP-6802 Agent cannot compile catalog if it specifies an non-existent environment in puppet.conf even when the classifier is controlling environment
-
- Resolved
-
-
PUP-7766 Puppet 5.0 Regression: puppet resource with --modulepath no longer loads expected code
-
- Closed
-
- supports
-
PUP-6554 Can't run puppet resource on agent with environment specified in main section
-
- Resolved
-