The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #9901

2.7.3 ubuntu package triggers 'Kernel.daemonize is too dangerous' where 2.6.3 did not

Added by Jos Boumans about 3 years ago. Updated over 1 year ago.

Status:DuplicateStart date:10/04/2011
Priority:HighDue date:
Assignee:-% Done:

0%

Category:server
Target version:-
Affected Puppet version: Branch:
Keywords:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


Description

Hi, when trying to update to 2.7.3, our (2.6.3) clients started getting puppet errors. The logs show the following line:

Oct  4 21:09:59 puppet-agent[2753]: Could not retrieve catalog from remote server: Error 400 on SERVER: Kernel.daemonize is too dangerous, please don't try to use it.

We’re running Ubuntu 10.04 on EC2 using the official canonical images. The server was running 2.6.3 from mathiaz' ppa and is again after a downgrade which made the issues go away:

$ dpkg -l|grep puppet
ii  puppet                            2.6.3-0ubuntu1~lucid1             Centralized configuration management - agent
ii  puppet-common                     2.6.3-0ubuntu1~lucid1             Centralized configuration management
ii  puppet-dashboard                  1.1.0-1                           Dashboard for Puppet
ii  puppetmaster-common               2.6.3-0ubuntu1~lucid1             Puppet master common scripts
ii  puppetmaster-passenger            2.6.3-0ubuntu1~lucid1             Centralised configuration management - master

Related issues

Duplicates Puppet - Refactor #1427: using missing_method for variable looking in TemplateWrap... Closed 07/16/2008

History

#1 Updated by James Turnbull almost 3 years ago

  • Description updated (diff)

#2 Updated by James Turnbull almost 3 years ago

  • Status changed from Unreviewed to Needs More Information
  • Assignee set to Anonymous

I have a vague memory of discussing this with you Daniel? Un-assign if I am wrong. It’s from this patch:

https://groups.google.com/group/puppet-dev/browse_thread/thread/0213755171a24c70/e34652d0765fe9e2?pli=1

That seems sane to me.

Jos – you still seeing this?

#3 Updated by Nick Lewis almost 3 years ago

This is very strange. That method should, as it says, never be called. I believe we only ever try to daemonize a Puppet::Daemon, which has its own implementation. The only other sort of object I can imagine being in that spot is nil, which would cause this behavior. Either that or the web server is trying to fork using a Kernel#daemonize method of its own, and our method is being defined after its, preventing it from daemonizing.

#4 Updated by James Turnbull almost 3 years ago

  • Status changed from Needs More Information to Accepted
  • Assignee changed from Anonymous to Nick Lewis

I commented out this on the master (2.7.9) and it all works:

lib/puppet/util/monkey_patches.rb

class Object
  # ActiveSupport 2.3.x mixes in a dangerous method
  # that can cause rspec to fork bomb
  # and other strange things like that.
  def daemonize
    raise NotImplementedError, "Kernel.daemonize is too dangerous, please don't try to use it."
  end   
end

The client is Ubuntu 2.6.3 and the master is Apache/Passenger running 2.7.9 on Ubuntu with Apache/Passenger config straight from the puppetmaster-passenger package on Ubuntu 10.04.

#5 Updated by Anonymous almost 3 years ago

James Turnbull wrote:

I commented out this on the master (2.7.9) and it all works:

lib/puppet/util/monkey_patches.rb

[…]

The client is Ubuntu 2.6.3 and the master is Apache/Passenger running 2.7.9 on Ubuntu with Apache/Passenger config straight from the puppetmaster-passenger package on Ubuntu 10.04.

Better would be to add a mandatory backtrace, and ask the user to report that bug and trace to our BTS. Which I would also ask you to peer at, since daemonizing again probably doesn’t do healthy things for our code.

#6 Updated by James Turnbull almost 3 years ago

Okay trace attached:

### master ###
/home/ubuntu/sources/git/puppet/lib/puppet/util/monkey_patches.rb:59:in `daemonize'
/data/sources/git/krux_interchange.2-jib/puppet-new/puppet/env/development/krux-modules/kredis/templates/redis.conf.erb:17:in `result'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/templatewrapper.rb:106:in `result'
/home/ubuntu/sources/git/puppet/lib/puppet/util.rb:180:in `benchmark'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/ubuntu/sources/git/puppet/lib/puppet/util.rb:179:in `benchmark'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/templatewrapper.rb:103:in `result'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/functions/template.rb:18:in `function_template'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/functions/template.rb:10:in `collect'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/functions/template.rb:10:in `function_template'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/ast/function.rb:33:in `send'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/ast/function.rb:33:in `evaluate'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/ast.rb:76:in `safeevaluate'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/ast/resourceparam.rb:18:in `evaluate'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/ast.rb:76:in `safeevaluate'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/ast/resource.rb:29:in `evaluate'
/home/ubuntu/sources/git/puppet/lib/puppet/util/autoload.rb:77:in `collect'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/ast/branch.rb:16:in `each'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/ast/branch.rb:15:in `each'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/ast/resource.rb:28:in `collect'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/ast/resource.rb:28:in `evaluate'
/home/ubuntu/sources/git/puppet/lib/puppet/util/autoload.rb:77:in `collect'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/ast/branch.rb:16:in `each'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/ast/branch.rb:15:in `each'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/ast/resource.rb:25:in `collect'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/ast/resource.rb:25:in `evaluate'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/ast.rb:76:in `safeevaluate'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/ast/astarray.rb:25:in `evaluate'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/ast/astarray.rb:20:in `each'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/ast/astarray.rb:20:in `evaluate'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/ast.rb:76:in `safeevaluate'
/home/ubuntu/sources/git/puppet/lib/puppet/resource/type.rb:74:in `evaluate_code'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/resource.rb:85:in `evaluate'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/compiler.rb:260:in `evaluate_definitions'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/compiler.rb:260:in `each'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/compiler.rb:260:in `evaluate_definitions'
/home/ubuntu/sources/git/puppet/lib/puppet/util/errors.rb:35:in `exceptwrap'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/compiler.rb:259:in `evaluate_definitions'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/compiler.rb:275:in `evaluate_generators'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/compiler.rb:270:in `loop'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/compiler.rb:270:in `evaluate_generators'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/compiler.rb:105:in `compile'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/compiler.rb:24:in `compile'
/home/ubuntu/sources/git/puppet/lib/puppet/indirector/catalog/compiler.rb:77:in `compile'
/home/ubuntu/sources/git/puppet/lib/puppet/util.rb:180:in `benchmark'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/ubuntu/sources/git/puppet/lib/puppet/util.rb:179:in `benchmark'
/home/ubuntu/sources/git/puppet/lib/puppet/indirector/catalog/compiler.rb:75:in `compile'
/home/ubuntu/sources/git/puppet/lib/puppet/indirector/catalog/compiler.rb:35:in `find'
/home/ubuntu/sources/git/puppet/lib/puppet/indirector/indirection.rb:189:in `find'
/home/ubuntu/sources/git/puppet/lib/puppet/network/http/handler.rb:106:in `do_find'
/home/ubuntu/sources/git/puppet/lib/puppet/network/http/handler.rb:68:in `send'
/home/ubuntu/sources/git/puppet/lib/puppet/network/http/handler.rb:68:in `process'
/home/ubuntu/sources/git/puppet/lib/puppet/network/http/webrick/rest.rb:24:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/home/ubuntu/sources/git/puppet/lib/puppet/network/http/webrick.rb:45
/usr/lib/ruby/1.8/webrick/server.rb:173:in `call'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/ubuntu/sources/git/puppet/lib/puppet/network/http/webrick.rb:42:in `listen'
/home/ubuntu/sources/git/puppet/lib/puppet/network/http/webrick.rb:41:in `initialize'
/home/ubuntu/sources/git/puppet/lib/puppet/network/http/webrick.rb:41:in `new'
/home/ubuntu/sources/git/puppet/lib/puppet/network/http/webrick.rb:41:in `listen'
/home/ubuntu/sources/git/puppet/lib/puppet/network/http/webrick.rb:38:in `synchronize'
/home/ubuntu/sources/git/puppet/lib/puppet/network/http/webrick.rb:38:in `listen'
/home/ubuntu/sources/git/puppet/lib/puppet/network/server.rb:127:in `listen'
/home/ubuntu/sources/git/puppet/lib/puppet/network/server.rb:142:in `start'
/home/ubuntu/sources/git/puppet/lib/puppet/daemon.rb:124:in `start'
/home/ubuntu/sources/git/puppet/lib/puppet/application/master.rb:202:in `main'
/home/ubuntu/sources/git/puppet/lib/puppet/application/master.rb:144:in `run_command'
/home/ubuntu/sources/git/puppet/lib/puppet/application.rb:306:in `run'
/home/ubuntu/sources/git/puppet/lib/puppet/application.rb:410:in `hook'
/home/ubuntu/sources/git/puppet/lib/puppet/application.rb:306:in `run'
/home/ubuntu/sources/git/puppet/lib/puppet/application.rb:401:in `exit_on_fail'
/home/ubuntu/sources/git/puppet/lib/puppet/application.rb:306:in `run'
/home/ubuntu/sources/git/puppet/lib/puppet/util/command_line.rb:69:in `execute'
/home/ubuntu/sources/git/puppet/lib/../bin/puppet:5
err: Kernel.daemonize is too dangerous, please don't try to use it.
debug: Received report to process from hbase-dev001.krxd.net.af3da497-bdc4-4c4f-8c24-57f0821cdaf6
debug: Processing report from hbase-dev001.krxd.net.af3da497-bdc4-4c4f-8c24-57f0821cdaf6 with processor Puppet::Reports::Http
debug: Processing report from hbase-dev001.krxd.net.af3da497-bdc4-4c4f-8c24-57f0821cdaf6 with processor Puppet::Reports::Store
debug: Processing report from hbase-dev001.krxd.net.af3da497-bdc4-4c4f-8c24-57f0821cdaf6 with processor Puppet::Reports::Foreman
/usr/lib/ruby/1.8/puppet/reports/foreman.rb:29:in `process'
/home/ubuntu/sources/git/puppet/lib/puppet/indirector/report/processor.rb:37:in `process'
/home/ubuntu/sources/git/puppet/lib/puppet/indirector/report/processor.rb:55:in `processors'
/home/ubuntu/sources/git/puppet/lib/puppet/indirector/report/processor.rb:53:in `each'
/home/ubuntu/sources/git/puppet/lib/puppet/indirector/report/processor.rb:53:in `processors'
/home/ubuntu/sources/git/puppet/lib/puppet/indirector/report/processor.rb:30:in `process'
/home/ubuntu/sources/git/puppet/lib/puppet/indirector/report/processor.rb:14:in `save'
/home/ubuntu/sources/git/puppet/lib/puppet/indirector/indirection.rb:265:in `save'
/home/ubuntu/sources/git/puppet/lib/puppet/network/http/handler.rb:164:in `do_save'
/home/ubuntu/sources/git/puppet/lib/puppet/network/http/handler.rb:68:in `send'
/home/ubuntu/sources/git/puppet/lib/puppet/network/http/handler.rb:68:in `process'
/home/ubuntu/sources/git/puppet/lib/puppet/network/http/webrick/rest.rb:24:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/home/ubuntu/sources/git/puppet/lib/puppet/network/http/webrick.rb:45
/usr/lib/ruby/1.8/webrick/server.rb:173:in `call'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/ubuntu/sources/git/puppet/lib/puppet/network/http/webrick.rb:42:in `listen'
/home/ubuntu/sources/git/puppet/lib/puppet/network/http/webrick.rb:41:in `initialize'
/home/ubuntu/sources/git/puppet/lib/puppet/network/http/webrick.rb:41:in `new'
/home/ubuntu/sources/git/puppet/lib/puppet/network/http/webrick.rb:41:in `listen'
/home/ubuntu/sources/git/puppet/lib/puppet/network/http/webrick.rb:38:in `synchronize'
/home/ubuntu/sources/git/puppet/lib/puppet/network/http/webrick.rb:38:in `listen'
/home/ubuntu/sources/git/puppet/lib/puppet/network/server.rb:127:in `listen'
/home/ubuntu/sources/git/puppet/lib/puppet/network/server.rb:142:in `start'
/home/ubuntu/sources/git/puppet/lib/puppet/daemon.rb:124:in `start'
/home/ubuntu/sources/git/puppet/lib/puppet/application/master.rb:202:in `main'
/home/ubuntu/sources/git/puppet/lib/puppet/application/master.rb:144:in `run_command'
/home/ubuntu/sources/git/puppet/lib/puppet/application.rb:306:in `run'
/home/ubuntu/sources/git/puppet/lib/puppet/application.rb:410:in `hook'
/home/ubuntu/sources/git/puppet/lib/puppet/application.rb:306:in `run'
/home/ubuntu/sources/git/puppet/lib/puppet/application.rb:401:in `exit_on_fail'
/home/ubuntu/sources/git/puppet/lib/puppet/application.rb:306:in `run'
/home/ubuntu/sources/git/puppet/lib/puppet/util/command_line.rb:69:in `execute'
/home/ubuntu/sources/git/puppet/lib/../bin/puppet:5

client

ubuntu@hbase-dev001:~$ sudo puppet agent --test --masterport=8161 --trace
notice: Ignoring --listen on onetime run
info: Retrieving plugin
info: Loading facts in root_home
info: Loading facts in krux_classes
info: Loading facts in facter_dot_d
info: Loading facts in root_home
info: Loading facts in krux_classes
info: Loading facts in facter_dot_d
/usr/lib/ruby/1.8/puppet/indirector/rest.rb:56:in `deserialize'
/usr/lib/ruby/1.8/puppet/indirector/rest.rb:120:in `find'
/usr/lib/ruby/1.8/puppet/indirector/indirection.rb:189:in `find'
/usr/lib/ruby/1.8/puppet/configurer.rb:237:in `retrieve_new_catalog'
/usr/lib/ruby/1.8/puppet/util.rb:476:in `thinmark'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/usr/lib/ruby/1.8/puppet/util.rb:475:in `thinmark'
/usr/lib/ruby/1.8/puppet/configurer.rb:236:in `retrieve_new_catalog'
/usr/lib/ruby/1.8/puppet/configurer.rb:86:in `retrieve_catalog'
/usr/lib/ruby/1.8/puppet/configurer.rb:112:in `retrieve_and_apply_catalog'
/usr/lib/ruby/1.8/puppet/configurer.rb:151:in `run'
/usr/lib/ruby/1.8/puppet/agent.rb:39
/usr/lib/ruby/1.8/puppet/agent/locker.rb:21:in `lock'
/usr/lib/ruby/1.8/puppet/agent.rb:39
/usr/lib/ruby/1.8/sync.rb:230:in `synchronize'
/usr/lib/ruby/1.8/puppet/agent.rb:39
/usr/lib/ruby/1.8/puppet/agent.rb:103:in `with_client'
/usr/lib/ruby/1.8/puppet/agent.rb:37
/usr/lib/ruby/1.8/puppet/application.rb:172:in `call'
/usr/lib/ruby/1.8/puppet/application.rb:172:in `controlled_run'
/usr/lib/ruby/1.8/puppet/agent.rb:35:in `run'
/usr/lib/ruby/1.8/puppet/application/agent.rb:336:in `onetime'
/usr/lib/ruby/1.8/puppet/application/agent.rb:310:in `run_command'
/usr/lib/ruby/1.8/puppet/application.rb:306:in `run'
/usr/lib/ruby/1.8/puppet/application.rb:410:in `hook'
/usr/lib/ruby/1.8/puppet/application.rb:306:in `run'
/usr/lib/ruby/1.8/puppet/application.rb:401:in `exit_on_fail'
/usr/lib/ruby/1.8/puppet/application.rb:306:in `run'
/usr/lib/ruby/1.8/puppet/util/command_line.rb:69:in `execute'
/usr/bin/puppet:4
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Kernel.daemonize is too dangerous, please don't try to use it.
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run

#7 Updated by Anonymous almost 3 years ago

Awesome. Can you change the puppet variable daemonize in the redis module to something, anything, else, please?

Specifically, like the fork variable, and any other “variable” that we try to look up through the method_missing hook, if Object or Kernel define something overlapping it will take precedence.

You could also use the member variable syntax <%= @daemonize %> rather than the method syntax <%= daemonize %> here:

/home/ubuntu/sources/git/puppet/lib/puppet/util/monkey_patches.rb:59:in `daemonize'
/data/sources/git/krux_interchange.2-jib/puppet-new/puppet/env/development/krux-modules/kredis/templates/redis.conf.erb:17:in `result'
/home/ubuntu/sources/git/puppet/lib/puppet/parser/templatewrapper.rb:106:in `result'

Specifically, you want the kredis module, redis.conf.erb template, line 17, as that trace indicates. :)

I have linked #1427, which is the other report of this same problem. With an entertaining submitter.

#8 Updated by Anonymous almost 3 years ago

  • Status changed from Accepted to Duplicate
  • Assignee changed from Nick Lewis to Anonymous

#9 Updated by Anonymous over 2 years ago

  • Target version deleted (2.7.x)

#10 Updated by Anonymous over 1 year ago

  • Assignee deleted (Anonymous)

Also available in: Atom PDF