- From: Daniel DeLeo <
>
- To:
- Subject: [chef] Re: chef-client failure on vanilla Ubuntu 11.04
- Date: Mon, 23 Jan 2012 11:30:49 -0800
On Monday, January 23, 2012 at 11:25 AM,
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.
>
>
:/etc/chef#
>
uname -n
>
cheftestclient.dev.spergatronic.com
>
(http://cheftestclient.dev.spergatronic.com)
>
>
:/etc/chef#
>
lsb_release -a
>
No LSB modules are available.
>
Distributor ID: Ubuntu
>
Description: Ubuntu 11.04
>
Release: 11.04
>
Codename: natty
>
>
:/etc/chef#
>
chef-client -v
>
Chef: 0.8.16
>
>
>
the first chef-client run:
>
>
:/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:
>
>
:/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) ~
>
>
>
>
:/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
>
>
>
:/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
Archive powered by MHonArc 2.6.16.