[chef] Re: chef-client runs only locally as root


Chronological Thread 
  • From: Joshua Timberman < >
  • To:
  • Subject: [chef] Re: chef-client runs only locally as root
  • Date: Thu, 11 Mar 2010 11:58:59 -0700

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello!

That error looks like one I ran into where 'ruby' wasn't in the $PATH, though 'ruby1.8' was. Are you on a system like Debian that has separate ruby1.8 and ruby packages, and 'ruby' isn't installed?


On Mar 11, 2010, at 11:18 AM, Gilles Devaux wrote:

Hi,

I am trying to execute chef-client remotely but I run into this exception:

/usr/local/lib/ruby/gems/1.8/gems/ohai-0.5.0/lib/ohai/system.rb: 121:in `join': can't convert nil into String (TypeError)
from /usr/local/lib/ruby/gems/1.8/gems/ohai-0.5.0/lib/ohai/ system.rb:121:in `all_plugins'
from /usr/local/lib/ruby/gems/1.8/gems/ohai-0.5.0/lib/ohai/ system.rb:118:in `each'
from /usr/local/lib/ruby/gems/1.8/gems/ohai-0.5.0/lib/ohai/ system.rb:118:in `all_plugins'
from /usr/local/lib/ruby/gems/1.8/gems/chef-0.8.6/bin/../lib/ chef/client.rb:121:in `run_ohai'
from /usr/local/lib/ruby/gems/1.8/gems/chef-0.8.6/bin/../lib/ chef/client.rb:126:in `determine_node_name'
from /usr/local/lib/ruby/gems/1.8/gems/chef-0.8.6/bin/../lib/ chef/client.rb:83:in `run'
from /usr/local/lib/ruby/gems/1.8/gems/chef-0.8.6/bin/../lib/ chef/application/client.rb:204:in `run_application'
from /usr/local/lib/ruby/gems/1.8/gems/chef-0.8.6/bin/../lib/ chef/application/client.rb:196:in `loop'
from /usr/local/lib/ruby/gems/1.8/gems/chef-0.8.6/bin/../lib/ chef/application/client.rb:196:in `run_application'
from /usr/local/lib/ruby/gems/1.8/gems/chef-0.8.6/bin/../lib/ chef/application.rb:57:in `run'
from /usr/local/lib/ruby/gems/1.8/gems/chef-0.8.6/bin/chef- client:26
       from /usr/local/bin/chef-client:19:in `load'
       from /usr/local/bin/chef-client:19

Here is the debug log

[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: Loading plugin kernel
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: ---- Begin uname -s STDOUT ----
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: Linux
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: ---- End uname -s STDOUT ----
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: ---- Begin uname -s STDERR ----
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG:
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: ---- End uname -s STDERR ----
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: Ran  (uname -s) returned 0
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: ---- Begin uname -r STDOUT ----
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: 2.6.32.1-rscloud
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: ---- End uname -r STDOUT ----
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: ---- Begin uname -r STDERR ----
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG:
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: ---- End uname -r STDERR ----
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: Ran  (uname -r) returned 0
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: ---- Begin uname -v STDOUT ----
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: #15 SMP Mon Feb 22 13:22:15 UTC 2010
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: ---- End uname -v STDOUT ----
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: ---- Begin uname -v STDERR ----
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG:
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: ---- End uname -v STDERR ----
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: Ran  (uname -v) returned 0
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: ---- Begin uname -m STDOUT ----
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: x86_64
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: ---- End uname -m STDOUT ----
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: ---- Begin uname -m STDERR ----
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG:
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: ---- End uname -m STDERR ----
[Thu, 11 Mar 2010 18:09:45 +0000] DEBUG: Ran  (uname -m) returned 0

I am having the same exception when:
- I invoke sudo chef-client from a non-root user (this is the same use case as trying remotely with ssh 'sudo chef-client'
- the chef-client deamon runs every 30 minutes -> the deamon runs as root:root: (root 1218 0.0 0.9 92588 19360 ? S Mar10 0:00 /usr/local/bin/ruby /usr/bin/chef-client -d -c /etc/ chef/client.rb -i 1800 -s 20 -L /var/log/chef/client.log)

only running chef-client as root locally works.

I have the same $PATH in both cases:
- running as root
- running as sudo (I have included /sbin, /usr/sbin, /usr/local/sbin)

Any help appreciated at this point

Thanks

--Gilles

- --
Opscode, Inc
Joshua Timberman, Senior Solutions Engineer
C: 720.334.RUBY E: 


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)

iEUEARECAAYFAkuZPXMACgkQO97WSdVpzT0QkQCYwHgvaYZQt9JEu1sJceNSSeTU
BgCfQguUm3WMF3HnV0Au07pFSr3TYo0=
=lZiw
-----END PGP SIGNATURE-----



Archive powered by MHonArc 2.6.16.

§