Chef-client failure on vanilla Ubuntu 11.04

hello. up until now i had been successfully running chef-clients on
CentOS against my Ubuntu chef server. now i’m trying to fire up some
ubuntu clients, and they are failing.

the failure case is constructed in the most simple way:

  • i install chef-client on vanilla Ubuntu 11.04
  • i run chef-client using a simple runlist: recipe[quick_start]
  • it fails, yet the node is registered successfully on the server.
  • the first run yields one error message, the immediate second run
    yields a different error message.

first error msg:
/usr/lib/ruby/1.8/json/common.rb:122:in `parse’: undefined class/module Chef::CookbookVersion (ArgumentError)

second error msg:
/usr/lib/ruby/1.8/chef/node.rb:329:in json_create': undefined methodeach’ for nil:NilClass (NoMethodError)

what to do? i’m hoping it’s something easy, something i’m overlooking,
but i can’t find it.

here are the details:

the ubuntu chef-server is 0.10.8-1.

root@cheftestclient:/etc/chef# uname -n
cheftestclient.dev.spergatronic.com

root@cheftestclient:/etc/chef# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 11.04
Release: 11.04
Codename: natty

root@cheftestclient:/etc/chef# chef-client -v
Chef: 0.8.16

the first chef-client run:

root@cheftestclient:/etc/chef# chef-client -j j.json -l debug -L /var/log/chef/client.log -V
[snip]
[Mon, 23 Jan 2012 19:09:00 +0000] DEBUG: Saving the current state of node cheftestclient.dev.spergatronic.com
[Mon, 23 Jan 2012 19:09:00 +0000] DEBUG: Signing the request as cheftestclient.dev.spergatronic.com
[Mon, 23 Jan 2012 19:09:00 +0000] DEBUG: Sending HTTP Request via POST to chef.dev.spergatronic.com:443/nodes
[Mon, 23 Jan 2012 19:09:00 +0000] DEBUG: Signing the request as cheftestclient.dev.spergatronic.com
[Mon, 23 Jan 2012 19:09:00 +0000] DEBUG: Sending HTTP Request via GET to chef.dev.spergatronic.com:443/nodes/cheftestclient.dev.spergatronic.com
[Mon, 23 Jan 2012 19:09:00 +0000] DEBUG: Synchronizing cookbooks
[Mon, 23 Jan 2012 19:09:00 +0000] DEBUG: Signing the request as cheftestclient.dev.spergatronic.com
[Mon, 23 Jan 2012 19:09:00 +0000] DEBUG: Sending HTTP Request via GET to chef.dev.spergatronic.com:443/nodes/cheftestclient.dev.spergatronic.com/cookbooks
/usr/lib/ruby/1.8/json/common.rb:122:in parse': undefined class/module Chef::CookbookVersion (ArgumentError) from /usr/lib/ruby/1.8/json/common.rb:122:inparse’
from /usr/lib/ruby/1.8/chef/rest.rb:202:in api_request' from /usr/lib/ruby/1.8/chef/rest.rb:267:inretriable_rest_request’
from /usr/lib/ruby/1.8/chef/rest.rb:197:in api_request' from /usr/lib/ruby/1.8/chef/rest.rb:100:inget_rest’
from /usr/lib/ruby/1.8/chef/client.rb:270:in sync_cookbooks' from /usr/lib/ruby/1.8/chef/client.rb:86:inrun’
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:inloop’
from /usr/lib/ruby/1.8/chef/application/client.rb:207:in run_application' from /usr/lib/ruby/1.8/chef/application.rb:62:inrun’
from /usr/bin/chef-client:25

in spite of above failure, the node was registered on the server:

[chefsrv chef-repo]$ knife node show cheftestclient.dev.spergatronic.com
Node Name: cheftestclient.dev.spergatronic.com
Environment: _default
FQDN: cheftestclient.dev.spergatronic.com
IP: 50.16.xx.xx
Run List: recipe[quick_start]
Roles:
Recipes:
Platform: ubuntu 11.04

the second run immediately after the first:

root@cheftestclient:/etc/chef# chef-client -j j.json -l debug -L /var/log/chef/client.log -V
[Mon, 23 Jan 2012 19:11:59 +0000] INFO: Starting Chef Run
[Mon, 23 Jan 2012 19:12:02 +0000] DEBUG: Client key /etc/chef/client.pem is present - skipping registration
[Mon, 23 Jan 2012 19:12:02 +0000] DEBUG: Building node object for cheftestclient.dev.spergatronic.com
[Mon, 23 Jan 2012 19:12:02 +0000] DEBUG: Signing the request as cheftestclient.dev.spergatronic.com
[Mon, 23 Jan 2012 19:12:02 +0000] DEBUG: Sending HTTP Request via GET to chef.dev.spergatronic.com:443/nodes/cheftestclient.dev.spergatronic.com
/usr/lib/ruby/1.8/chef/node.rb:329:in json_create': undefined methodeach’ for nil:NilClass (NoMethodError)
from /usr/lib/ruby/1.8/json/common.rb:122:in parse' from /usr/lib/ruby/1.8/json/common.rb:122:inparse’
from /usr/lib/ruby/1.8/chef/rest.rb:202:in api_request' from /usr/lib/ruby/1.8/chef/rest.rb:267:inretriable_rest_request’
from /usr/lib/ruby/1.8/chef/rest.rb:197:in api_request' from /usr/lib/ruby/1.8/chef/rest.rb:100:inget_rest’
from /usr/lib/ruby/1.8/chef/client.rb:151:in build_node' from /usr/lib/ruby/1.8/chef/client.rb:84:inrun’
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:inloop’
from /usr/lib/ruby/1.8/chef/application/client.rb:207:in run_application' from /usr/lib/ruby/1.8/chef/application.rb:62:inrun’
from /usr/bin/chef-client:25

tailing the server log, i only see:

merb : chef-server (api) : worker (port 4000) ~ Started request handling: Mon Jan 23 19:13:27 +0000 2012
merb : chef-server (api) : worker (port 4000) ~ Params: {“format”=>nil, “action”=>“show”, “id”=>“cheftestclient.dev.spergatronic.com”, “controller”=>“nodes”}
merb : chef-server (api) : worker (port 4000) ~ {:dispatch_time=>0.026753, :after_filters_time=>1.3e-05, :before_filters_time=>0.010166, :action_time=>0.026342}
merb : chef-server (api) : worker (port 4000) ~

root@cheftestclient:/etc/chef# cat client.rb
log_level :info
log_location STDOUT
ssl_verify_mode :verify_none
node_name "cheftestclient.dev.spergatronic.com"
chef_server_url "https://chef.dev.spergatronic.com"
file_cache_path "/var/cache/chef"
file_backup_path "/var/lib/chef/backup"
pid_file "/var/run/chef/client.pid"
cache_options({ :path => “/var/cache/chef/checksums”, :skip_expires => true})
signing_ca_user "chef"
Mixlib::Log::Formatter.show_time = true

root@cheftestclient:/etc/chef# cat j.json
{
“run_list”: [
“recipe[quick_start]”
]
}

thanks,
kallen

On Monday, January 23, 2012 at 11:25 AM, kallen@groknaut.net wrote:

hello. up until now i had been successfully running chef-clients on
CentOS against my Ubuntu chef server. now i'm trying to fire up some
ubuntu clients, and they are failing.

the failure case is constructed in the most simple way:

  • i install chef-client on vanilla Ubuntu 11.04
  • i run chef-client using a simple runlist: recipe[quick_start]
  • it fails, yet the node is registered successfully on the server.
  • the first run yields one error message, the immediate second run
    yields a different error message.

first error msg:
/usr/lib/ruby/1.8/json/common.rb:122:in `parse': undefined class/module Chef::CookbookVersion (ArgumentError)

second error msg:
/usr/lib/ruby/1.8/chef/node.rb:329:in json_create': undefined method each' for nil:NilClass (NoMethodError)

what to do? i'm hoping it's something easy, something i'm overlooking,
but i can't find it.

here are the details:

the ubuntu chef-server is 0.10.8-1.

root@cheftestclient:/etc/chef# uname -n
cheftestclient.dev.spergatronic.com (http://cheftestclient.dev.spergatronic.com)

root@cheftestclient:/etc/chef# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 11.04
Release: 11.04
Codename: natty

root@cheftestclient:/etc/chef# chef-client -v
Chef: 0.8.16

the first chef-client run:

root@cheftestclient:/etc/chef# chef-client -j j.json -l debug -L /var/log/chef/client.log -V
[snip]
[Mon, 23 Jan 2012 19:09:00 +0000] DEBUG: Saving the current state of node cheftestclient.dev.spergatronic.com (http://cheftestclient.dev.spergatronic.com)
[Mon, 23 Jan 2012 19:09:00 +0000] DEBUG: Signing the request as cheftestclient.dev.spergatronic.com (http://cheftestclient.dev.spergatronic.com)
[Mon, 23 Jan 2012 19:09:00 +0000] DEBUG: Sending HTTP Request via POST to chef.dev.spergatronic.com:443/nodes (http://chef.dev.spergatronic.com:443/nodes)
[Mon, 23 Jan 2012 19:09:00 +0000] DEBUG: Signing the request as cheftestclient.dev.spergatronic.com (http://cheftestclient.dev.spergatronic.com)
[Mon, 23 Jan 2012 19:09:00 +0000] DEBUG: Sending HTTP Request via GET to chef.dev.spergatronic.com:443/nodes/cheftestclient.dev.spergatronic.com (http://chef.dev.spergatronic.com:443/nodes/cheftestclient.dev.spergatronic.com)
[Mon, 23 Jan 2012 19:09:00 +0000] DEBUG: Synchronizing cookbooks
[Mon, 23 Jan 2012 19:09:00 +0000] DEBUG: Signing the request as cheftestclient.dev.spergatronic.com (http://cheftestclient.dev.spergatronic.com)
[Mon, 23 Jan 2012 19:09:00 +0000] DEBUG: Sending HTTP Request via GET to chef.dev.spergatronic.com:443/nodes/cheftestclient.dev.spergatronic.com/cookbooks (http://chef.dev.spergatronic.com:443/nodes/cheftestclient.dev.spergatronic.com/cookbooks)
/usr/lib/ruby/1.8/json/common.rb:122:in parse': undefined class/module Chef::CookbookVersion (ArgumentError) from /usr/lib/ruby/1.8/json/common.rb:122:in parse'
from /usr/lib/ruby/1.8/chef/rest.rb:202:in api_request' from /usr/lib/ruby/1.8/chef/rest.rb:267:in retriable_rest_request'
from /usr/lib/ruby/1.8/chef/rest.rb:197:in api_request' from /usr/lib/ruby/1.8/chef/rest.rb:100:in get_rest'
from /usr/lib/ruby/1.8/chef/client.rb:270:in sync_cookbooks' from /usr/lib/ruby/1.8/chef/client.rb:86: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

in spite of above failure, the node was registered on the server:

[chefsrv chef-repo]$ knife node show cheftestclient.dev.spergatronic.com (http://cheftestclient.dev.spergatronic.com)
Node Name: cheftestclient.dev.spergatronic.com (http://cheftestclient.dev.spergatronic.com)
Environment: _default
FQDN: cheftestclient.dev.spergatronic.com (http://cheftestclient.dev.spergatronic.com)
IP: 50.16.xx.xx
Run List: recipe[quick_start]
Roles:
Recipes:
Platform: ubuntu 11.04

the second run immediately after the first:

root@cheftestclient:/etc/chef# chef-client -j j.json -l debug -L /var/log/chef/client.log -V
[Mon, 23 Jan 2012 19:11:59 +0000] INFO: Starting Chef Run
[Mon, 23 Jan 2012 19:12:02 +0000] DEBUG: Client key /etc/chef/client.pem is present - skipping registration
[Mon, 23 Jan 2012 19:12:02 +0000] DEBUG: Building node object for cheftestclient.dev.spergatronic.com (http://cheftestclient.dev.spergatronic.com)
[Mon, 23 Jan 2012 19:12:02 +0000] DEBUG: Signing the request as cheftestclient.dev.spergatronic.com (http://cheftestclient.dev.spergatronic.com)
[Mon, 23 Jan 2012 19:12:02 +0000] DEBUG: Sending HTTP Request via GET to chef.dev.spergatronic.com:443/nodes/cheftestclient.dev.spergatronic.com (http://chef.dev.spergatronic.com:443/nodes/cheftestclient.dev.spergatronic.com)
/usr/lib/ruby/1.8/chef/node.rb:329:in json_create': undefined method each' for nil:NilClass (NoMethodError)
from /usr/lib/ruby/1.8/json/common.rb:122:in parse' from /usr/lib/ruby/1.8/json/common.rb:122:in parse'
from /usr/lib/ruby/1.8/chef/rest.rb:202:in api_request' from /usr/lib/ruby/1.8/chef/rest.rb:267:in retriable_rest_request'
from /usr/lib/ruby/1.8/chef/rest.rb:197:in api_request' from /usr/lib/ruby/1.8/chef/rest.rb:100:in get_rest'
from /usr/lib/ruby/1.8/chef/client.rb:151:in build_node' from /usr/lib/ruby/1.8/chef/client.rb:84: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

tailing the server log, i only see:

merb : chef-server (api) : worker (port 4000) ~ Started request handling: Mon Jan 23 19:13:27 +0000 2012
merb : chef-server (api) : worker (port 4000) ~ Params: {"format"=>nil, "action"=>"show", "id"=>"cheftestclient.dev.spergatronic.com (http://cheftestclient.dev.spergatronic.com)", "controller"=>"nodes"}
merb : chef-server (api) : worker (port 4000) ~ {:dispatch_time=>0.026753, :after_filters_time=>1.3e-05, :before_filters_time=>0.010166, :action_time=>0.026342}
merb : chef-server (api) : worker (port 4000) ~

root@cheftestclient:/etc/chef# cat client.rb
log_level :info
log_location STDOUT
ssl_verify_mode :verify_none
node_name "cheftestclient.dev.spergatronic.com (http://cheftestclient.dev.spergatronic.com)"
chef_server_url "https://chef.dev.spergatronic.com"
file_cache_path "/var/cache/chef"
file_backup_path "/var/lib/chef/backup"
pid_file "/var/run/chef/client.pid"
cache_options({ :path => "/var/cache/chef/checksums", :skip_expires => true})
signing_ca_user "chef"
Mixlib::Log::Formatter.show_time = true

root@cheftestclient:/etc/chef# cat j.json
{
"run_list": [
"recipe[quick_start]"
]
}

thanks,
kallen

The issue is that you've installed from apt, but the version in the upstream repos is really old. Add apt.opscode.com to your sources and reinstall and you should be good to go.

--
Dan DeLeo

On Mon, 23 Jan 2012, Daniel DeLeo wrote:

On Monday, January 23, 2012 at 11:25 AM, kallen@groknaut.net wrote:

hello. up until now i had been successfully running chef-clients on
CentOS against my Ubuntu chef server. now i'm trying to fire up some
ubuntu clients, and they are failing.

The issue is that you've installed from apt, but the version in the upstream repos is really old. Add apt.opscode.com to your sources and reinstall and you should be good to go.

heh, yeah i thot version 0.8.16 seemed odd. thank you! works now.

kallen

a suggestion for documentation clarity ..

i was following this doc for creating an AMI:
http://wiki.opscode.com/display/chef/Amazon+EC2+AMIs+with+Chef

the doc's chef install instructions focus on gem installing. there's
a mention that one could install via apt, but doesn't remind the reader
to be certain to use opscode's repo. perhaps add that note?

On Mon, 23 Jan 2012, kallen@groknaut.net wrote:

On Mon, 23 Jan 2012, Daniel DeLeo wrote:

On Monday, January 23, 2012 at 11:25 AM, kallen@groknaut.net wrote:

hello. up until now i had been successfully running chef-clients on
CentOS against my Ubuntu chef server. now i'm trying to fire up some
ubuntu clients, and they are failing.

The issue is that you've installed from apt, but the version in the upstream repos is really old. Add apt.opscode.com to your sources and reinstall and you should be good to go.

heh, yeah i thot version 0.8.16 seemed odd. thank you! works now.

kallen

On Mon, Jan 23, 2012 at 12:12 PM, kallen@groknaut.net wrote:

i was following this doc for creating an AMI:
http://wiki.opscode.com/display/chef/Amazon+EC2+AMIs+with+Chef

the doc's chef install instructions focus on gem installing. there's
a mention that one could install via apt, but doesn't remind the reader
to be certain to use opscode's repo. perhaps add that note?

Thanks. I have added a note pointing to the apt installation
directions as suggested.

Bryan

On Mon, 23 Jan 2012, Bryan McLellan wrote:

On Mon, Jan 23, 2012 at 12:12 PM, kallen@groknaut.net wrote:

i was following this doc for creating an AMI:
http://wiki.opscode.com/display/chef/Amazon+EC2+AMIs+with+Chef

the doc's chef install instructions focus on gem installing. there's
a mention that one could install via apt, but doesn't remind the reader
to be certain to use opscode's repo. perhaps add that note?

Thanks. I have added a note pointing to the apt installation
directions as suggested.

much appreciated.