The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com
https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:
Incoherent error message on ERB syntax error
|Affected Puppet version:||0.25.4||Branch:|
I have had the following ERB template with a syntax error on the first line (missing % for password variable):
test -z "<%= user %>" || export USER_PIECE="--username <%= user %> --password <%= password >" if svn info <%= destination %> 2> /dev/null; then svn -q --non-interactive $USER_PIECE up <%= destination %>; else mkdir -p <%= destination %>; svn -q --non-interactive $USER_PIECE co <%= source %> <%= destination %>; fi;
This is the puppet output:
bash-3.2# puppetd --test ...... info: Loading facts in rm_privs info: Loading facts in env_vars err: Could not retrieve catalog from remote server: wrong header line format warning: Not using cache on failed catalog err: Could not retrieve catalog; skipping run
I think it would be helpful to have ERB compilation errors more coherent to make debugging easier.
#5 Updated by Nigel Kersten almost 5 years ago
This totally isn’t clear, but the Affected Puppet version is meant to indicate the earliest version we’ve observed it in, which is why we set it back.
Error reporting in general is an area we need improvement in and are targeting for the next release, particularly around passing errors from the master down to the agent.
The puppet master will report the errors because that’s where template evaluation is done, but it’s frustrating when you’re sitting at the agent.
Given how easy it is to introduce syntax errors in erb templates, best practice is to have validation on all your erb files in a pre-commit hook.