Puppet: Error 400 on SERVER ArgumentError: malformed format string – %S at …

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, July 30, 2013

Follow me on Twitter as @mattiasgeniar

Here’s an error to screw with your debugging skills.

~$ puppet agent -t
Info: Retrieving plugin
Info: Loading facts in /var/lib/puppet/lib/facter/concat_basedir.rb
...
Info: Loading facts in /var/lib/puppet/lib/facter/vmwaretools_version.rb
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError: malformed format string - %S at /etc/puppet/manifests/yourhosntame.pp:13 on node [yournodename]
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

There’s probably nothing wrong with either the syntax or the data inside your manifests or modules. In fact, the line-number in the error could point you to a completely unrelated place in your code.

What’s more than likely to cause the problem is external data like hiera. If you’re using a yaml/xml/mysql backend, make sure the data in it is valid and not malformed. When using yaml, check the syntax and the encoding of all your entities and attributes.



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.