This is a collection of error messages I got while setting up a puppet infrastructure and testing modules, as well as their reasons ans solutions.
- Failed to load library ‘msgpack’
- Could not retrieve information from environment
- Could not find data item classes in any Hiera data file
- No such file or directory @ dir_s_rmdir
- This ‘if’ statement is not productive
- sslv3 alert certificate revoked or certificate verify failed
Failed to load library ‘msgpack’
Message
On an agent:
Debug: Failed to load library 'msgpack' for feature 'msgpack' Debug: Puppet::Network::Format[msgpack]: feature msgpack is missing
on the master:
Debug: Puppet::Network::Format[msgpack]: feature msgpack is missing Debug: file_metadata supports formats: pson b64_zlib_yaml yaml raw
Context
This happens when you run puppet agent, for instance.
Reason
msgpack is an efficient serialisation format. Puppet uses is (experimentally) when communicating between master and agent. This format requires a gem, which if not installed will give this debug message. This is completely harmless, it just pollutes your logs.
Fix
Just install the msgpack ruby gem. Depending on your system, you can
#debian based: apt-get install ruby-msgpack #generic gem install msgpack
This immediately removes the debug messages. To actually use msgpack, you need to add in the [main] or [agent] section of puppet.conf the line:
preferred_serialization_format
=msgpack
Could not retrieve information from environment
Message
Error: /File[/var/lib/puppet/facts.d]: Could not evaluate: Could not retrieve information from environment $yourenvironment source(s) puppet://localhost/pluginfacts
Context
Puppet agent run.
Reason
If no module has a facts.d folder, puppet will throw this error. This is an actual bug in puppet, at least version 3.7.3.
Fix
Option 1: Just discard. This is shown as an error, but has no impact and the run will carry on uninterrupted.
Option 2: actually create a facts.d folder in a module.
Could not find data item classes in any Hiera data file
Message
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find data item classes in any Hiera data file and no default supplied on node aws-nl-puppetmaster.dp.webpower.io
Context
Your puppet tests were all working fine from vagrant. You just installed a puppet master and the first agent run gives you this error.
Reason
Check your hiera.yaml file (in /etc/puppet/hiera.yaml, /etc/puppetlabs/puppet/hiera.yaml or pointed by hiera_config from your puppet.conf). There is a :datadir section, telling puppet where to find hiera data. If the path there is absolute, then it should directly point to the directory. If it is relative, then it works only under vagrant and is based on puppet.working_dir.
Fix
Many options are possible.
- Use a common absolute path everywhere.
- Put the directory, maybe via a link, in its default location.
- Puppet can interpolate variables when reading datadir, so if your issue is due to different environments, you could use a path like
“/var/hieradata/%{::environment}/configuration”
Note that if you change hiera.yaml, you need to reload the puppet master as hiera.yaml is only read at startup.
No such file or directory @ dir_s_rmdir
Message
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed when searching for node $nodename: No such file or directory @ dir_s_rmdir - /var/puppet/hiera/node/$nodename.yaml20150812-5415-1802nxn.lock
Context
Puppet agent run
Reason
- Puppet master tries to create a file in a directory he does not own, and has thus no permission.
- Puppet tries to create a file or directory whereas the parent does not exists.
- The partition where puppet tries to create a lock file is full.
Fix
- With the path given in the example error message:
chown -R puppet:puppet /var/puppet/hiera
- Make sure the parent is created in the manifest as well
This ‘if’ statement is not productive
Message
This 'if' statement is not productive.
followed by some more explnation depending on the context.
Context
Puppet agent run
Reason
Puppet does not want to leave alone, and pretends to know better than me. I might want to have a if (false) {…} or if (condition) {empty block} for whatever reasons, but no, puppet very violently and rudely bails out. There is a bug discussion about it as well as a fix to change the wording, but the behaviour will stay.
Fix
Comment out what puppet does not like.
sslv3 alert certificate revoked or certificate verify failed
Message
SSL_connect returned=1 errno=0 state=SSLv3 read server session ticket A: sslv3 alert certificate revoked
or
Wrapped exception: SSL_connect returned=1 errno=0 state=unknown state: certificate verify failed: [self signed certificate in certificate chain for /CN=Puppet CA: puppetmaster.example.com]
Context
Puppet agent run
Reason
You probably revoked or clean certificates on the puppet master, but did not inform the agent about it. or maybe you are now pointing to a new puppetmaster.
Fix
You can fix this by cleaning the agent as well:
sudo rm -r /etc/puppet/ssl sudo rm -r /var/lib/puppet/ssl