Jira (PUP-10960) Windows agent installer errors on environment mismatch

19 views
Skip to first unread message

Kevin Reeuwijk (Jira)

unread,
Mar 10, 2021, 9:56:03 AM3/10/21
to puppe...@googlegroups.com
Kevin Reeuwijk created an issue
 
Puppet / Improvement PUP-10960
Windows agent installer errors on environment mismatch
Issue Type: Improvement Improvement
Affects Versions: PUP 7.4.1
Assignee: Unassigned
Components: Windows
Created: 2021/03/10 6:55 AM
Priority: Normal Normal
Reporter: Kevin Reeuwijk

When migrating a Puppet Agent from one PE environment to another, there can be a change in the puppet code environment the node is classified in. On Linux, this does not cause a problem. However on Windows, this error occurs during installation of the agent, using the PE oneline-installer:

PS C:\Users\administrator.DREAMWORX> .\install.ps1 -v
VERBOSE: Transferring package from source
https://pe.dreamworx.nl:8140/packages/2021.0.0/windows-x86_64/puppet-agent-x64.msi
VERBOSE: Downloading the Puppet Agent for Puppet Enterprise on NEXUS...
Downloading bulk_pluginsync zipfile on NEXUS...
Extracting bulk_pluginsync zipfile on NEXUS...
VERBOSE: Detected Powershell version 4+... Using system.io.compression.filesystem
VERBOSE: Detected existing pluginsync cache directory.  Removing before zipfile extraction.
Saving the install log to C:\Users\administrator.DREAMWORX\AppData\Local\Temp\2\2021-03-10T15-18-19-puppet-install.log
Installing the Puppet Agent on NEXUS...
VERBOSE: Setting the Puppet Agent service to ensure=running and enable=true
Traceback (most recent call last):
        5: from C:/Program Files/Puppet Labs/Puppet/puppet/bin/puppet:4:in `<main>'
        4: from C:/Program Files/Puppet Labs/Puppet/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:77:in `execute'
        3: from C:/Program Files/Puppet Labs/Puppet/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:143:in `run'
        2: from C:/Program Files/Puppet Labs/Puppet/puppet/lib/ruby/vendor_ruby/puppet/application.rb:409:in `run'
        1: from C:/Program Files/Puppet Labs/Puppet/puppet/lib/ruby/vendor_ruby/puppet/application_support.rb:34:in `push_application_context'
C:/Program Files/Puppet Labs/Puppet/puppet/lib/ruby/vendor_ruby/puppet/environments.rb:40:in `get!': Could not find a directory environment named 'development' anywhere in the path: C:/ProgramData/PuppetLabs/code/environments. Does the directory exist? (Puppet::Environments::EnvironmentNotFound)
Installation has completed.

A mismatch in code environment should not cause an agent installation error at all.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Josh Cooper (Jira)

unread,
Mar 10, 2021, 2:07:03 PM3/10/21
to puppe...@googlegroups.com
Josh Cooper commented on Improvement PUP-10960
 
Re: Windows agent installer errors on environment mismatch

This is probably caused by PUP-6554. If you set environment in the main section and run puppet resource, then puppet requires that the environment directory exist, since it may need to load types/providers from a module to manage the resource.

It is highly recommended that environment never be set in the main section, which is why we emit warning if --section is emitted when setting it from the CLI:

$ bx puppet config set environment dev
Warning: The environment should be set in either the `[user]`, `[agent]`, or `[server]`
section. Variables set in the `[agent]` section are used when running
`puppet agent`. Variables set in the `[user]` section are used when running
various other puppet subcommands, like `puppet apply` and `puppet module`; these
require the defined environment directory to exist locally. Set the config
section by using the `--section` flag. For example,
`puppet config --section user set environment foo`. For more information, see
https://puppet.com/docs/puppet/latest/configuration.html#environment

Reply all
Reply to author
Forward
0 new messages