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
1 |
find . | xargs file | grep "CRLF" |
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.
1 |
dos2unix <file> |
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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
enable-auto-props = yes ### Section for configuring automatic properties. [auto-props] # Puppet *.pp = svn:eol-style=native *.erb = svn:eol-style=native *.conf = svn:eol-style=native # *.dsp = svn:eol-style=CRLF *.dsw = svn:eol-style=CRLF *.sh = svn:eol-style=native;svn:executable *.txt = svn:eol-style=native;svn:keywords=Author Date Id Rev URL; # Java *.java = svn:eol-style=native *.properties = svn:mime-type=text/plain;svn:eol-style=native *.xml = svn:mime-type=text/xml;svn:eol-style=native *.xsl = svn:mime-type=text/xml;svn:eol-style=native *.xsd = svn:mime-type=text/xml;svn:eol-style=native *.wsdl = svn:mime-type=text/xml;svn:eol-style=native *.pl = svn:eol-style=native *.py = svn:eol-style=native *.cmd = svn:eol-style=native *.bat = svn:eol-style=native *.htm* = svn:eol-style=native;svn:mime-type=text/html *.css = svn:eol-style=native *.js = svn:eol-style=native ## Misc Text Files README* = svn:eol-style=native;svn:mime-type=text/plain LICENSE* = svn:eol-style=native;svn:mime-type=text/plain ChangeLog = svn:eol-style=native;svn:mime-type=text/plain ## Binary *.png = svn:mime-type=image/png *.jpg = svn:mime-type=image/jpeg *.gif = svn:mime-type=image/gif *.png = svn:mime-type=image/png ## C/C++ Files Makefile = svn:eol-style=native *.c = svn:eol-style=native *.cpp = svn:eol-style=native *.h = svn:eol-style=native *.hpp = svn:eol-style=native |
Be the first to comment. Leave a comment