Jira (PUP-10307) puppet plugin download fails if agent specified environment doesn't exist on the agent

12 views
Skip to first unread message

Josh Cooper (JIRA)

unread,
Feb 21, 2020, 11:52:04 AM2/21/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Puppet / Bug PUP-10307
puppet plugin download fails if agent specified environment doesn't exist on the agent
Change By: Josh Cooper
Team: Coremunity
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Josh Cooper (JIRA)

unread,
Feb 21, 2020, 11:52:04 AM2/21/20
to puppe...@googlegroups.com
Josh Cooper created an issue
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2020/02/21 8:51 AM
Priority: Normal Normal
Reporter: Josh Cooper

Add a dev environment to /etc/puppetlabs/code/environments/dev on the puppetserver.
On a different host, the agent run will succeed, but plugin download will fail:

$ puppet agent -t -E dev
Info: Using configured environment 'dev'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Caching catalog for XXX
Info: Applying configuration version '1582303430'
$  bx puppet plugin download  -E dev
bundler: failed to load command: puppet (/Users/josh/work/puppet/.bundle/ruby/2.3.0/bin/puppet)
Puppet::Environments::EnvironmentNotFound: Could not find a directory environment named 'dev' anywhere in the path: /Users/josh/.puppetlabs/etc/code/environments. Does the directory exist?
  /Users/josh/work/puppet/lib/puppet/environments.rb:40:in `get!'
  /Users/josh/work/puppet/lib/puppet/application_support.rb:34:in `push_application_context'
  /Users/josh/work/puppet/lib/puppet/application.rb:370:in `run'
  /Users/josh/work/puppet/lib/puppet/util/command_line.rb:143:in `run'
  /Users/josh/work/puppet/lib/puppet/util/command_line.rb:77:in `execute'
  /Users/josh/work/puppet/bin/puppet:5:in `<top (required)>'
  /Users/josh/work/puppet/.bundle/ruby/2.3.0/bin/puppet:22:in `load'
  /Users/josh/work/puppet/.bundle/ruby/2.3.0/bin/puppet:22:in `<top (required)>'

The problem is the plugin application needs to specify that the environment is not required to exist locally:

diff --git a/lib/puppet/application/plugin.rb b/lib/puppet/application/plugin.rb
index 2d0402e43f..06beb9eabf 100644
--- a/lib/puppet/application/plugin.rb
+++ b/lib/puppet/application/plugin.rb
@@ -1,3 +1,4 @@
 require 'puppet/application/face_base'
 class Puppet::Application::Plugin < Puppet::Application::FaceBase
+  environment_mode :not_required
 end

Josh Cooper (Jira)

unread,
Mar 18, 2020, 4:09:04 PM3/18/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Epic Link: PUP-7563
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Josh Cooper (Jira)

unread,
May 7, 2020, 11:05:03 AM5/7/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
May 7, 2020, 11:05:03 AM5/7/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
May 7, 2020, 11:05:04 AM5/7/20
to puppe...@googlegroups.com

Melissa Stone (Jira)

unread,
May 12, 2020, 4:10:03 PM5/12/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
May 13, 2020, 2:50:03 PM5/13/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes: Bug Fix
Release Notes Summary: Calling `puppet plugin download --environment <env>` failed if the environment directory didn't exist locally, which it typically won't when running the command on a host different from the host running puppetserver.

Melissa Stone (Jira)

unread,
May 13, 2020, 6:56:04 PM5/13/20
to puppe...@googlegroups.com
 
Re: puppet plugin download fails if agent specified environment doesn't exist on the agent

This has passed ci as a part of puppet-agent 6.15.0.185.gf3447d61

Claire Cadman (Jira)

unread,
May 19, 2020, 9:59:02 AM5/19/20
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages