Puppet 400 Error ‘getcwd’

Technical Note

puppet:  Could not retrieve catalog from remote server Error 400 on SERVER "Could not parse for environment" getcwd

Puppet Master Version 2.7.18. Puppet Agent Version 2.7.18.

Intermittent 400 error "could not parse environment: dev' occurs on an otherwise normally working production server. This failure does not occur in local workstation testing environment.

Check for DOS Encoding

LRCF and ^M line endings from DOS encoded files create weird side-effects in code running under Linux.

I had recently updated my Eclipse IDE. The default encoding changed from UTF-8. I created new Puppet modules which were committed to a Subversion repository.  Those modules eventually were checked out to the Puppet Master.

Find DOS encoded Files

The new modules and svn files were located.

Temporary Fix

Reset Eclipse IDE encoding to UTF-8 with Unix line endings.

Change all .svn and puppet files to Unix encoding using dos2unix command.

Puppet runs returned to normal.

Permanent Fix

Set the svn:eol-style in subversion to allow development on heterogeneous platforms.

In my Puppet setup, the puppet user's home directory is /var/lib/puppet.  Subversion stores its configuration file there: /var/lib/puppet/.subversion/config.  An example configuration is:

 

December 10th, 2013 Posted by Jon Jaroker Filed in: Puppet ,

Be the first to comment. Leave a comment

Your email address will not be published. Required fields are marked *