When you are creating and defining new template, Puppet use it to parse the file in the agent server but sometimes you might misspelled/right wrong config which leads to throwing error on puppet agent.
One of the error which i received is “Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template context.erb:” and i found the root cause of the error, so thought of sharing..
If you are getting the same error as below :
[root@webapp007 conf]# puppet agent --test
Info: Retrieving pluginfacts
Info: Retrieving plugin
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template context.erb:
Detail: uninitialized constant Puppet::Parser::TemplateWrapper::VMS_USER
at /etc/puppet/manifests/classes/smart.pp:140 on node webapp007
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
Reason : Puppet doesnot support ALLCAPS variable in puppet templates
Solution : Change ALLCAPS variable to lower case variable
In this case : VMS_USER to vms_user
and thats it …..once you change the varibale – Puppet will happily run after that