Chef/mixin/language_include_attribute.rb:45:in `include_attribute': undefined method `[]' for nil:NilClass (NoMethodError)


#1

Hello,

Today, I was adding an additional node to my Chef 0.8.16 setup. As I
did with my previous nodes, I followed the following instructions:

http://wiki.opscode.com/display/chef/Preparing+Debian+and+Ubuntu+for+RubyGems
http://wiki.opscode.com/display/chef/Bootstrap+Chef+RubyGems+Installation

Now that Chef 0.9 is released, and some of the wiki docs updated for
that, I took care to use the 0.8 instructions: installing RubyGems
1.3.6 and explicitely installing chef 0.8.16.

When I ran chef solo with the bootstrap::client recipe, I got the
stacktrace as can be seen here:

/usr/lib/ruby/gems/1.8/gems/chef-0.8.16/bin/…/lib/chef/mixin/language_include_attribute.rb:45:in
include_attribute': undefined method[]’ for nil:NilClass
(NoMethodError)
from /usr/lib/ruby/gems/1.8/gems/chef-0.8.16/bin/…/lib/chef/mixin/language_include_attribute.rb:32:in
each' from /usr/lib/ruby/gems/1.8/gems/chef-0.8.16/bin/../lib/chef/mixin/language_include_attribute.rb:32:ininclude_attribute’
from /tmp/chef-solo/cookbooks/chef/attributes/server_proxy.rb:20:in from_file' from /usr/lib/ruby/gems/1.8/gems/chef-0.8.16/bin/../lib/chef/cookbook.rb:83:inload_attribute_file’
from /usr/lib/ruby/gems/1.8/gems/chef-0.8.16/bin/…/lib/chef/cookbook.rb:76:in
load_attributes' from /usr/lib/ruby/gems/1.8/gems/chef-0.8.16/bin/../lib/chef/cookbook.rb:75:ineach’
from /usr/lib/ruby/gems/1.8/gems/chef-0.8.16/bin/…/lib/chef/cookbook.rb:75:in
load_attributes' from /usr/lib/ruby/gems/1.8/gems/chef-0.8.16/bin/../lib/chef/compile.rb:78:inload_attributes’
from /usr/lib/ruby/gems/1.8/gems/chef-0.8.16/bin/…/lib/chef/cookbook_loader.rb:137:in
each' from /usr/lib/ruby/gems/1.8/gems/chef-0.8.16/bin/../lib/chef/cookbook_loader.rb:136:ineach’
from /usr/lib/ruby/gems/1.8/gems/chef-0.8.16/bin/…/lib/chef/compile.rb:77:in
load_attributes' from /usr/lib/ruby/gems/1.8/gems/chef-0.8.16/bin/../lib/chef/compile.rb:52:ininitialize’
from /usr/lib/ruby/gems/1.8/gems/chef-0.8.16/bin/…/lib/chef/client.rb:329:in
new' from /usr/lib/ruby/gems/1.8/gems/chef-0.8.16/bin/../lib/chef/client.rb:329:inconverge’
from /usr/lib/ruby/gems/1.8/gems/chef-0.8.16/bin/…/lib/chef/client.rb:108:in
run_solo' from /usr/lib/ruby/gems/1.8/gems/chef-0.8.16/bin/../lib/chef/application/solo.rb:198:inrun_application’
from /usr/lib/ruby/gems/1.8/gems/chef-0.8.16/bin/…/lib/chef/application/solo.rb:190:in
loop' from /usr/lib/ruby/gems/1.8/gems/chef-0.8.16/bin/../lib/chef/application/solo.rb:190:inrun_application’
from /usr/lib/ruby/gems/1.8/gems/chef-0.8.16/bin/…/lib/chef/application.rb:62:in
run' from /usr/lib/ruby/gems/1.8/gems/chef-0.8.16/bin/chef-solo:25 from /usr/bin/chef-solo:19:inload’
from /usr/bin/chef-solo:19

Full debug from the chef-solo run:

On all my previous nodes, this worked flawlessly. I am either missing
something on this node, or the bootstrap-latest cookbooks on S3 are
also updated for Chef 0.9 rendering them incompatible with 0.8.16.
However, I can not validate the latter as
http://s3.amazonaws.com/chef-solo/ doesn’t return an index file list.

Any help is appreciated.

Ringo


#2

Hello,

I tried it again on another machine. Installed Chef 0.8.16, copied the
bootstrap cookbooks in /tmp/chef-solo from a node where the install
went fine, but still no go. The same error persists.

I double-checked gem versions between a working and a failing node and
they all seem to match.

Are you guys trying to push us towards 0.9? :slight_smile:

Ringo


#3

Hmm… I was able to link this to CHEF-1231. I’m puzzled why it worked
on all my previous nodes though.

Ringo.


#4

Ohai!
I’m not sure when this bug was introduced, but I believe it is fixed
in 0.9.0. This isn’t a conspiracy to force you to upgrade, just that’s
when it happened to be fixed. Also, the opscode cookbooks tend to
track the latest version of chef, but we make older bootstrap
cookbooks available by version number, for example:
http://s3.amazonaws.com/chef-solo/bootstrap-0.8.16.tar.gz will get you
the bootstrap recipes for 0.8.16. I’ll look into adding git tags to
the cookbooks repo, which would allow you to checkout the cookbooks at
a given chef version, but if we do this it might be just for 0.9
onwards.

HTH,
Dan DeLeo

On Fri, Jun 25, 2010 at 6:19 AM, Ringo De Smet ringo.desmet@gmail.com wrote:

Hmm… I was able to link this to CHEF-1231. I’m puzzled why it worked
on all my previous nodes though.

Ringo.