-
Type:
Bug
-
Status: Closed
-
Priority:
Normal
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: PUP 4.8.0
-
Component/s: None
-
Labels:
-
Template:customfield_10700 152415
-
Master Config:Monolithic
-
Agent OS:RHEL 7 (x86_64)
-
Master OS:RHEL 7 (x86_64)
-
Team:Next Generation
-
Story Points:5
-
Sprint:NG 2016-10-05, NG 2016-10-19
-
Release Notes:Bug Fix
-
Release Notes Summary:
Overview
Using a function that references an undefined variable (ie by typo) in a function crashes puppetserver with an out of memory error
Expected result
Puppet should warn the user if an undefined variable is encountered. Ideally in the output of puppet agent -t
Actual result
Puppet runs take a long time and then fail with one of the following messages:
Error: Could not retrieve catalog from remote server: end of file reached
|
Warning: Not using cache on failed catalog
|
Error: Could not retrieve catalog; skipping run
|
Error: Could not send report: Connection refused - connect(2) for "puppet.demo.internal" port 8140
|
or
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: <html>
|
<head>
|
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
|
<title>Error 500 </title>
|
</head>
|
<body>
|
<h2>HTTP ERROR: 500</h2>
|
<p>Problem accessing /puppet/v3/catalog/pe-puppet.localdomain. Reason:
|
<pre> Java heap space</pre></p>
|
<hr /><i><small>Powered by Jetty://</small></i>
|
</body>
|
</html>
|
|
Warning: Not using cache on failed catalog
|
Error: Could not retrieve catalog; skipping run
|
Also, please see attached puppetserver.log
Steps to reproduce
Testcase module
/etc/puppetlabs/code/environments/production/modules/testcase/lib/puppet/functions/testfunc.rb
Puppet::Functions.create_function(:testfunc) do
|
def testfunc
|
nothere
|
end
|
end
|
Reference the function
/etc/puppetlabs/code/environments/production/manifests/site.pp
$uhoh=testfunc()
|
Run puppet
puppet agent -t
|
Workaround
Make sure you don't reference any undeclared variables