When attempting to use modules copied into the Puppet modules directory, my puppet client returns ' Could not retrieve catalog from remote server: Error 400 on SERVER: can't convert nil in String' errors when connecting to the Puppet master server.
[root@puppetmaster modules]# rpm -qa *puppet*
puppet-2.7.18-1.el6.noarch
puppet-server-2.7.18-1.el6.noarch
[root@puppetmaster modules]# uname -sr
Linux 2.6.32-279.el6.x86_64
Code all checks out and is valid. SELinux is turned on.
In this case, the files were moved with 'mv' instead of copied with 'cp'. SELinux does not change the files to the default context of the destination with 'mv' as it would with 'cp'.
Because of this, Puppet could not read the module files and thus the 'include' was failing in the calling .pp file. Because the read was failing, there was a 'nil' where code was expected to be.
Verify the SELinux properties of the Puppet module directories.
Puppet has its own SELinux settings and your files there should be set to it. If copied in from elsewhere, they'll be incorrect.
To set this back to the default, you can run
restorecon -R /etc/puppet
, which will recursively reset all the puppet modules to functional SELinux settings for use in Puppet.HT: @MichaelHampton