Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applying gnupg_key fails if an Agent-side directory environment is missing #15

Open
mattock opened this issue Nov 13, 2015 · 4 comments
Labels

Comments

@mattock
Copy link
Contributor

mattock commented Nov 13, 2015

Applying gnupg_key resources fail if the node running the agent is missing a directory environment matching the environment given in /etc/puppetlabs/puppet/puppet.conf (or on the command-line):

$ puppet agent --test
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for server.domain.com
Info: Applying configuration version '1447410145'
Error: Could not find a directory environment named 'testing' anywhere in the path: /etc/puppetlabs/code/environments. Does the directory exist?
Error: /Stage[main]/Freight::Config::Gnupg/Gnupg_key[freight-public-key]/ensure: change from absent to present failed: Could not find a directory environment named 'testing' anywhere in the path: /etc/puppetlabs/code/environments. Does the directory exist?
Error: Could not find a directory environment named 'testing' anywhere in the path: /etc/puppetlabs/code/environments. Does the directory exist?
Error: /Stage[main]/Freight::Config::Gnupg/Gnupg_key[freight-private-key]/ensure: change from absent to present failed: Could not find a directory environment named 'testing' anywhere in the path: /etc/puppetlabs/code/environments. Does the directory exist?
Notice: Applied catalog in 0.36 seconds

This problem can be circumvented by creating the said directory environment on the node that runs the Puppe Agent:

$ mkdir /etc/puppetlabs/code/environments/testing
$ puppet agent --test
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for server.domain.com
Info: Applying configuration version '1447410758'
Notice: /Stage[main]/Freight::Config::Gnupg/Gnupg_key[freight-public-key]/ensure: created
Notice: /Stage[main]/Freight::Config::Gnupg/Gnupg_key[freight-private-key]/ensure: created
Notice: Applied catalog in 0.43 seconds

This problem is reproducible on Puppet 4.2.3. I have not tested any of the earlier versions. On the puppetserver side the environment is correctly configured, and nothing suspicious shows up in /var/log/puppetlabs/puppetserver/puppetserver.log. So this failure occurs strictly on the agent side.

@dgolja
Copy link
Owner

dgolja commented Nov 13, 2015

Hey tnx for that. Officially this module does not support puppet 4.2.X, but I will definitely have a look and try to find a solution for that.

@dgolja dgolja added the feature label Nov 13, 2015
@mrbanzai
Copy link

mrbanzai commented Nov 1, 2016

I, too, am running into this issue (again, with Puppet 4). I'm guessing it has something to do with one of the lookups in the provider, but I'm sadly ignorant when it comes to the Puppet Ruby API. If I do manage to nail it down, I'll try to contribute a PR.

@flhe
Copy link

flhe commented Jan 26, 2017

Same here. Ubuntu 16.04 and Puppet 4.X. Is the code still maintained in github ?

@mattock
Copy link
Contributor Author

mattock commented Jan 3, 2019

This problem still exists with Puppet 5.x and Ubuntu 18.04. With r10k and feature branches/environments this is pretty bad, because during development you won't be running the Puppet Agent in the production environment (the only environment which tends to exist even on Agent nodes).

mjrasobarnett added a commit to mjrasobarnett/golja-gnupg that referenced this issue May 28, 2019
This commit should resolve the problem discussed in Issue dgolja#15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants