Chef-client 11.4.4-1 error: NoMethodError: undefined method `[]' for nil:NilClass


#1

Hi list,

The following error started popping up after I started provisioning a new
VM with the latest chef-cliet v. 11.4.4-1. It did not happen last time,
when I used v.10.14.4, here is the stacktrace from the node:

NoMethodError: undefined method `[]’ for nil:NilClass

/tmp/chef-solo/cookbooks/ruby/recipes/default.rb:4:in from_file' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/mixin/from_file.rb:30:ininstance_eval’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/mixin/from_file.rb:30:in
from_file' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/cookbook_version.rb:346:inload_recipe’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context.rb:151:in
load_recipe' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context.rb:132:inblock in include_recipe’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context.rb:131:in
each' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context.rb:131:ininclude_recipe’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/dasl/include_recipe.rb:26:in
include_recipe' /tmp/chef-solo/cookbooks/fullofcaffeine/recipes/default.rb:28:infrom_file’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/mixin/from_file.rb:30:in
instance_eval' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/mixin/from_file.rb:30:infrom_file’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/cookbook_version.rb:346:in
load_recipe' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context.rb:151:inload_recipe’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context/cookbook_compiler.rb:139:in
block in compile_recipes' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context/cookbook_compiler.rb:137:ineach’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context/cookbook_compiler.rb:137:in
compile_recipes' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context/cookbook_compiler.rb:74:incompile’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context.rb:86:in
load' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/client.rb:224:insetup_run_context’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/client.rb:467:in
do_run' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/client.rb:200:inrun’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/application.rb:190:in
run_chef_client' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/application/solo.rb:239:inblock in run_application’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/application/solo.rb:231:in
loop' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/application/solo.rb:231:inrun_application’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/application.rb:73:in
run' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/bin/chef-solo:25:in<top (required)>’
/usr/bin/chef-solo:23:in load' /usr/bin/chef-solo:23:in

I’m not sure why this is happening, could someone enlighten me?

Thanks in advance,

Marcelo.


#2

On Wednesday, April 24, 2013 at 3:27 PM, Marcelo de Moraes Serpa wrote:

Hi list,

The following error started popping up after I started provisioning a new VM with the latest chef-cliet v. 11.4.4-1. It did not happen last time, when I used v.10.14.4, here is the stacktrace from the node:

Your cookbooks metadata is missing a dependency statement. chef-solo uses the dependencies to load attribute (and other) files in a sane order.

http://docs.opscode.com/breaking_changes_chef_11.html#non-recipe-file-evaluation-includes-dependencies


Daniel DeLeo


#3

Hi Daniel,

Thanks for pointing me to the right direction!

Cheers,

Marcelo.

On Wed, Apr 24, 2013 at 5:34 PM, Daniel DeLeo dan@kallistec.com wrote:

On Wednesday, April 24, 2013 at 3:27 PM, Marcelo de Moraes Serpa wrote:

Hi list,

The following error started popping up after I started provisioning a new
VM with the latest chef-cliet v. 11.4.4-1. It did not happen last time,
when I used v.10.14.4, here is the stacktrace from the node:

Your cookbooks metadata is missing a dependency statement. chef-solo uses
the dependencies to load attribute (and other) files in a sane order.

http://docs.opscode.com/breaking_changes_chef_11.html#non-recipe-file-evaluation-includes-dependencies


Daniel DeLeo