Issue #22930 has been updated by Josh Cooper.
Status changed from Unreviewed to Accepted
This is probably a duplicate. The problem is that `run_in_fork` assumes the
yielded block will return an integer value to exit with:
<pre>
def run_in_fork(forking = true)
...
exit(yield)
</pre>
However, if an exception is raised, the actual return value depends on what
`Puppet.log_exception` returns:
<pre>
result = run_in_fork(should_fork) do
with_client do |client|
begin
client_args = client_options.merge(:pluginsync =>
Puppet[:pluginsync])
lock { client.run(client_args) }
rescue SystemExit,NoMemoryError
raise
rescue Exception => detail
Puppet.log_exception(detail, "Could not run #{client_class}:
#{detail}")
end
end
end
</pre>
In this case, if execution times out, the log object is returned from the
yielded block. It should return a sensible non-zero exit code, e.g.
<pre>
rescue Exception => detail
Puppet.log_exception(...)
the-int-that-means-a-fatal-error-occurred
end
</pre>
----------------------------------------
Bug #22930: puppet agent backtrace - can't convert Puppet::Util::Log into
Integer (TypeError)
https://projects.puppetlabs.com/issues/22930#change-99290
* Author: Daniel Black
* Status: Accepted
* Priority: Normal
* Assignee:
* Category: agent
* Target version:
* Affected Puppet version: 3.2.4
* Keywords:
* Branch:
----------------------------------------
<pre>
Error: Could not run Puppet configuration client: execution expired
/usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/agent.rb:89:in `exit':
can't convert Puppet::Util::Log into Integer (TypeError)
from /usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/agent.rb:89:in
`run_in_fork'
from /usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/agent.rb:86:in
`fork'
from /usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/agent.rb:86:in
`run_in_fork'
from /usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/agent.rb:41:in
`run'
from
/usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/application.rb:179:in
`call'
from
/usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/application.rb:179:in
`controlled_run'
from /usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/agent.rb:39:in
`run'
from
/usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/daemon.rb:154:in
`run_event_loop'
from
/usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/scheduler/job.rb:49:in
`call'
from
/usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/scheduler/job.rb:49:in `run'
from
/usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/scheduler/scheduler.rb:40:in
`run_ready'
from
/usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/scheduler/scheduler.rb:35:in
`each'
from
/usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/scheduler/scheduler.rb:35:in
`run_ready'
from
/usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/scheduler/scheduler.rb:12:in
`run_loop'
from
/usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/daemon.rb:172:in
`run_event_loop'
from
/usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/daemon.rb:146:in `start'
from
/usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/application/agent.rb:372:in
`main'
from
/usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/application/agent.rb:328:in
`run_command'
from
/usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/application.rb:364:in `run'
from
/usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/application.rb:456:in
`plugin_hook'
from
/usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/application.rb:364:in `run'
from /usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/util.rb:504:in
`exit_on_fail'
from
/usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/application.rb:364:in `run'
from
/usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/util/command_line.rb:132:in
`run'
from
/usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/lib/puppet/util/command_line.rb:86:in
`execute'
from /usr/lib/ruby/gems/1.8/gems/puppet-3.2.4/bin/puppet:4
from /usr/bin/puppet:19:in `load'
from /usr/bin/puppet:19
</pre>
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.