Chef-client ignoring client.rb

I’m running chef .10.2-2 on Ubuntu 11.04 and attempting to use it with Amazon’s
auto scaling. I’m able to create the client.rb and pass the validation.pem but
chef-client appears to ignore all and try to connect to localhost:4000. Please
see the following:

cat /etc/chef/client.rb

log_level :info
log_location "/var/log/chef/client.log"
ssl_verify_mode :verify_none
validation_client_name "chef-validator"
validation_key "/etc/chef/validation.pem"
client_key "/etc/chef/client.pem"
chef_server_url "http://chef.pri.mydomain.com:4000"
file_cache_path "/var/cache/chef"
file_backup_path "/var/backups/chef"
pid_file "/var/run/chef/client.pid"
node_name “i-7b44f41a”

cat /var/log/chef/client.log

Logfile created on Thu Jul 28 02:01:55 +0000 2011 by logger.rb/22285

[Thu, 28 Jul 2011 02:01:55 +0000] INFO: Daemonizing…
[Thu, 28 Jul 2011 02:01:55 +0000] INFO: Forked, in 5550. Priveleges: 0 0
[Thu, 28 Jul 2011 02:02:14 +0000] INFO: Starting Chef Run
[Thu, 28 Jul 2011 02:02:19 +0000] INFO: Client key /etc/chef/client.pem is not
present - registering
[Thu, 28 Jul 2011 02:02:19 +0000] ERROR: Connection refused connecting to
localhost:4000 for /clients, retry 1/5
[Thu, 28 Jul 2011 02:02:24 +0000] ERROR: Connection refused connecting to
localhost:4000 for /clients, retry 2/5
[Thu, 28 Jul 2011 02:02:29 +0000] ERROR: Connection refused connecting to
localhost:4000 for /clients, retry 3/5
[Thu, 28 Jul 2011 02:02:34 +0000] ERROR: Connection refused connecting to
localhost:4000 for /clients, retry 4/5
[Thu, 28 Jul 2011 02:02:39 +0000] ERROR: Connection refused connecting to
localhost:4000 for /clients, retry 5/5
[Thu, 28 Jul 2011 02:02:44 +0000] ERROR: Errno::ECONNREFUSED
[Thu, 28 Jul 2011 02:02:44 +0000] FATAL: Connection refused - Connection
refused connecting to localhost:4000 for /clients, giving up
/usr/lib/ruby/1.8/chef/rest.rb:275:in retriable_rest_request' /usr/lib/ruby/1.8/chef/rest.rb:197:inapi_request’
/usr/lib/ruby/1.8/chef/rest.rb:111:in post_rest' /usr/lib/ruby/1.8/chef/api_client.rb:235:insave’
/usr/lib/ruby/1.8/chef/rest.rb:70:in register' /usr/lib/ruby/1.8/chef/rest.rb:68:inupto’
/usr/lib/ruby/1.8/chef/rest.rb:68:in register' /usr/lib/ruby/1.8/chef/rest.rb:66:incatch’
/usr/lib/ruby/1.8/chef/rest.rb:66:in register' /usr/lib/ruby/1.8/chef/client.rb:184:inregister’
/usr/lib/ruby/1.8/chef/client.rb:83:in run' /usr/lib/ruby/1.8/chef/application/client.rb:215:inrun_application’
/usr/lib/ruby/1.8/chef/application/client.rb:207:in loop' /usr/lib/ruby/1.8/chef/application/client.rb:207:inrun_application’
/usr/lib/ruby/1.8/chef/application.rb:62:in `run’
/usr/bin/chef-client:25
[Thu, 28 Jul 2011 02:02:44 +0000] FATAL: Sleeping for 1800 seconds before
trying again

For giggles I tried chef-client -c /etc/chef/client.rb and receive:

/usr/lib/ruby/1.8/chef/client.rb:313:in converge': undefined methodrun_list’
for nil:NilClass (NoMethodError)
from /usr/lib/ruby/1.8/chef/client.rb:87:in run' from /usr/lib/ruby/1.8/chef/application/client.rb:215:inrun_application’
from /usr/lib/ruby/1.8/chef/application/client.rb:207:in loop' from /usr/lib/ruby/1.8/chef/application/client.rb:207:inrun_application’
from /usr/lib/ruby/1.8/chef/application.rb:62:in `run’
from /usr/bin/chef-client:25

On Wednesday, July 27, 2011 at 9:33 PM, clif@texicans.us wrote:

I'm running chef .10.2-2 on Ubuntu 11.04 and attempting to use it with Amazon's
auto scaling. I'm able to create the client.rb and pass the validation.pem but
chef-client appears to ignore all and try to connect to localhost:4000. Please
see the following:

cat /etc/chef/client.rb

log_level :info
log_location "/var/log/chef/client.log"
ssl_verify_mode :verify_none
validation_client_name "chef-validator"
validation_key "/etc/chef/validation.pem"
client_key "/etc/chef/client.pem"
chef_server_url "http://chef.pri.mydomain.com:4000"
file_cache_path "/var/cache/chef"
file_backup_path "/var/backups/chef"
pid_file "/var/run/chef/client.pid"
node_name "i-7b44f41a"

cat /var/log/chef/client.log

Logfile created on Thu Jul 28 02:01:55 +0000 2011 by logger.rb/22285

[Thu, 28 Jul 2011 02:01:55 +0000] INFO: Daemonizing..
[Thu, 28 Jul 2011 02:01:55 +0000] INFO: Forked, in 5550. Priveleges: 0 0
[Thu, 28 Jul 2011 02:02:14 +0000] INFO: Starting Chef Run
[Thu, 28 Jul 2011 02:02:19 +0000] INFO: Client key /etc/chef/client.pem is not
present - registering
[Thu, 28 Jul 2011 02:02:19 +0000] ERROR: Connection refused connecting to
localhost:4000 for /clients, retry 1/5
[Thu, 28 Jul 2011 02:02:24 +0000] ERROR: Connection refused connecting to
localhost:4000 for /clients, retry 2/5
[Thu, 28 Jul 2011 02:02:29 +0000] ERROR: Connection refused connecting to
localhost:4000 for /clients, retry 3/5
[Thu, 28 Jul 2011 02:02:34 +0000] ERROR: Connection refused connecting to
localhost:4000 for /clients, retry 4/5
[Thu, 28 Jul 2011 02:02:39 +0000] ERROR: Connection refused connecting to
localhost:4000 for /clients, retry 5/5
[Thu, 28 Jul 2011 02:02:44 +0000] ERROR: Errno::ECONNREFUSED
[Thu, 28 Jul 2011 02:02:44 +0000] FATAL: Connection refused - Connection
refused connecting to localhost:4000 for /clients, giving up
/usr/lib/ruby/1.8/chef/rest.rb:275:in retriable_rest_request' /usr/lib/ruby/1.8/chef/rest.rb:197:in api_request'
/usr/lib/ruby/1.8/chef/rest.rb:111:in post_rest' /usr/lib/ruby/1.8/chef/api_client.rb:235:in save'
/usr/lib/ruby/1.8/chef/rest.rb:70:in register' /usr/lib/ruby/1.8/chef/rest.rb:68:in upto'
/usr/lib/ruby/1.8/chef/rest.rb:68:in register' /usr/lib/ruby/1.8/chef/rest.rb:66:in catch'
/usr/lib/ruby/1.8/chef/rest.rb:66:in register' /usr/lib/ruby/1.8/chef/client.rb:184:in register'
/usr/lib/ruby/1.8/chef/client.rb:83:in run' /usr/lib/ruby/1.8/chef/application/client.rb:215:in run_application'
/usr/lib/ruby/1.8/chef/application/client.rb:207:in loop' /usr/lib/ruby/1.8/chef/application/client.rb:207:in run_application'
/usr/lib/ruby/1.8/chef/application.rb:62:in `run'
/usr/bin/chef-client:25
[Thu, 28 Jul 2011 02:02:44 +0000] FATAL: Sleeping for 1800 seconds before
trying again

For giggles I tried chef-client -c /etc/chef/client.rb and receive:

/usr/lib/ruby/1.8/chef/client.rb:313:in converge': undefined method run_list'
for nil:NilClass (NoMethodError)
from /usr/lib/ruby/1.8/chef/client.rb:87:in run' from /usr/lib/ruby/1.8/chef/application/client.rb:215:in run_application'
from /usr/lib/ruby/1.8/chef/application/client.rb:207:in loop' from /usr/lib/ruby/1.8/chef/application/client.rb:207:in run_application'
from /usr/lib/ruby/1.8/chef/application.rb:62:in run' from /usr/bin/chef-client:25 Hey, so just to be certain, can you run chef-client -v` ? That doesn't look like the output from Chef 0.10, and the line numbers of the methods don't match up quite right. I'm not sure this has anything to do with your problem but it might. Also, what's the exact version of ruby you have?

Thanks,

--
Dan DeLeo