chef-client doesn't work "automatically"


Chronological Thread 
  • From: Albert Llop <mrsimo@gmail.com>
  • To: chef@lists.opscode.com
  • Subject: chef-client doesn't work "automatically"
  • Date: Wed, 17 Jun 2009 09:41:18 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=bYp5WsN2Hgihcf/l3nQ2V0Ly5inTFpqOESSOna5guTjR3lszFzGCZyzoEUDUn7t47G KFgLRasUq3n4K7ErHqeXqoHdiVTn0GG9ITp412BWIndQ5XV4q+tp7e5RvZlZX5S7RIZ1 qpEoXl229eUvrtYunKMdWzu02nzo1PXKdsIls=

I've been having some trouble with my chef-clients, I've my chef-server working properly, and my chef-clients can work just fine (with 0.7). I can login, and execute chef-client as root and it will work wonderfully.

But after that it just doesn't work. In the log you see this every 30mins:

[Wed, 17 Jun 2009 09:15:09 +0200] INFO: Starting Chef Run
[Wed, 17 Jun 2009 09:15:09 +0200] ERROR: Net::HTTPFatalError
[Wed, 17 Jun 2009 09:15:09 +0200] FATAL: 502 "Bad Gateway"
/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/1.8/net/http.rb:2097:in `error!'
/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.0/lib/chef/rest.rb:232:in `run_request'
/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.0/lib/chef/rest.rb:230:in `run_request'
/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.0/lib/chef/rest.rb:95:in `post_rest'
/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.0/lib/chef/client.rb:223:in `authenticate'
/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.0/lib/chef/client.rb:74:in `run'
/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.0/lib/chef/application/client.rb:163:in `run_application'
/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.0/lib/chef/application/client.rb:161:in `loop'
/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.0/lib/chef/application/client.rb:161:in `run_application'
/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.0/lib/chef/application.rb:53:in `run'
/opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/chef-0.7.0/bin/chef-client:26
/usr/bin/chef-client:19:in `load'
/usr/bin/chef-client:19
[Wed, 17 Jun 2009 09:15:09 +0200] FATAL: Sleeping for 1815 seconds before trying again

Then I log in and execute it manually, and this is the log:

[Wed, 17 Jun 2009 09:38:36 +0200] INFO: Starting Chef Run
[Wed, 17 Jun 2009 09:38:42 +0200] INFO: Updating template[/home/kom/.ssh/authorized_keys2] at /home/kom/.ssh/authorized_keys2
...
[Wed, 17 Jun 2009 09:38:53 +0200] INFO: Backing up template[/etc/nginx/sites-available/comerc] to /etc/nginx/sites-available/comerc.chef-20090617093853
[Wed, 17 Jun 2009 09:38:53 +0200] INFO: Chef Run complete in 17.132551 seconds

Any ideas why might this be happening? I see the chef-client is running as root:

# ps aux | grep chef-client
root     26512  0.0  0.0    112    28 ?        Ss   Jun09   0:00 runsv chef-client
root       408  0.0  6.5  36616 24112 ?        S    Jun12   0:14 /opt/ruby-enterprise-1.8.6-20090610/bin/ruby /usr/bin/chef-client -i 1800 -s 20 -L /var/log/chef/client.log

And nothing else I can think about.

Been thinking of using a cron job, but I don't really see the point when the service is running properly everywhere.

Cheers!

--
Albert Llop
Tech Department
albert@kingsofmambo.com




Archive powered by MHonArc 2.6.16.

§