Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

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.

[root@puppetmaster modules]# ls -Z
drwxr-xr-x. root root unconfined_u:object_r:puppet_etc_t:s0 acroread
drwxr-xr-x. root root unconfined_u:object_r:puppet_etc_t:s0 apt
drwxr-xr-x.  999 1000 unconfined_u:object_r:admin_home_t:s0 bindserver

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

share|improve this answer
    
Upvote for working through an SELinux problem instead of just turning it off –  Joel E Salas Sep 28 '12 at 0:33
    
The Red Hat SELinux guide has a full explanation of the difference between mv and cp when SELinux is in use. –  Michael Hampton Sep 28 '12 at 1:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.