Chef-solo using ruby 1.9.2.rc1 on ubuntu 10.4


#1

hi, is chef-solo known to work on 1.9.2.rc1? i had chef working on
1.8.7 but not 1.9.2 yet.

i’m trying to run the chef script and get an error about ": RuntimeError

Any workarounds?

sudo chef-solo -c config/solo.rb -j config/dna.json
[Sat, 10 Jul 2010 20:51:56 +0000] INFO: Setting the run_list to
[“ubuntu”, “build-essential”, “git”, “mysql::client”, “mysql::server”,
“java”] from JSON
[Sat, 10 Jul 2010 20:51:56 +0000] INFO: Starting Chef Run
[Sat, 10 Jul 2010 20:51:57 +0000] WARN: Missing gem ‘right_aws’
[Sat, 10 Jul 2010 20:51:57 +0000] WARN: Missing gem ‘mysql’
[Sat, 10 Jul 2010 20:51:57 +0000] INFO: Overriding duplicate definition
nginx_site, new found in
/root/chef-tc/cookbooks/nginx_entry/definitions/nginx_site.rb
[Sat, 10 Jul 2010 20:52:05 +0000] INFO: Ran execute[apt-get update]
successfully
[Sat, 10 Jul 2010 20:52:05 +0000] ERROR: Running exception handlers
[Sat, 10 Jul 2010 20:52:05 +0000] ERROR: Exception handlers complete
[Sat, 10 Jul 2010 20:52:05 +0000] ERROR: Re-raising exception:
RuntimeError - can’t add a new key into hash during iteration
/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/language.rb:41:in
`[]=’

/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/language.rb:41:in
`block (2 levels) in value_for_platform’

/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/language.rb:41:in
`each’

/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/language.rb:41:in
`block in value_for_platform’

/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/language.rb:39:in
`each_pair’

/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/language.rb:39:in
value_for_platform' /root/chef-tc/cookbooks/mysql/recipes/client.rb:23:inblock in
from_file’

/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/recipe_definition_dsl_core.rb:71:in
`instance_eval’

/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/recipe_definition_dsl_core.rb:71:in
method_missing' /root/chef-tc/cookbooks/mysql/recipes/client.rb:20:infrom_file’

/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/from_file.rb:30:in
`instance_eval’

/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/from_file.rb:30:in
`from_file’

/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/cookbook_version.rb:316:in
`load_recipe’

/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/language_include_recipe.rb:40:in
`block in include_recipe’

/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/language_include_recipe.rb:27:in
`each’

/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/language_include_recipe.rb:27:in
`include_recipe’

/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/run_context.rb:93:in
`block in load’

/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/run_context.rb:90:in
`each’

/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/run_context.rb:90:in
`load’

/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/run_context.rb:54:in
`initialize’

/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/client.rb:83:in
`new’

/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/client.rb:83:in
`run’

/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/application/solo.rb:193:in
`block in run_application’

/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/application/solo.rb:185:in
`loop’

/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/application/solo.rb:185:in
`run_application’

/usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/application.rb:62:in
run' /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/bin/chef-solo:25:in<top (required)>’
/usr/local/bin/chef-solo:19:in `load’


@tommychheng
Programmer and UC Irvine Graduate Student
Find a great grad school based on research interests: http://gradschoolnow.com


#2

We have positive reports of things working on 1.9.1, but
value_for_platform certainly does manipulate the hash while iterating
in certain instances.

Now bug CHEF-1438.

Adam

On Sat, Jul 10, 2010 at 1:58 PM, Tommy Chheng tommy.chheng@gmail.com wrote:

hi, is chef-solo known to work on 1.9.2.rc1? i had chef working on 1.8.7
but not 1.9.2 yet.

i’m trying to run the chef script and get an error about ": RuntimeError -
can’t add a new key into hash during iteration"
The cookbooks are the latest from github.com/opscode/cookbooks.git

Any workarounds?

sudo chef-solo -c config/solo.rb -j config/dna.json
[Sat, 10 Jul 2010 20:51:56 +0000] INFO: Setting the run_list to [“ubuntu”,
“build-essential”, “git”, “mysql::client”, “mysql::server”, “java”] from
JSON
[Sat, 10 Jul 2010 20:51:56 +0000] INFO: Starting Chef Run
[Sat, 10 Jul 2010 20:51:57 +0000] WARN: Missing gem ‘right_aws’
[Sat, 10 Jul 2010 20:51:57 +0000] WARN: Missing gem ‘mysql’
[Sat, 10 Jul 2010 20:51:57 +0000] INFO: Overriding duplicate definition
nginx_site, new found in
/root/chef-tc/cookbooks/nginx_entry/definitions/nginx_site.rb
[Sat, 10 Jul 2010 20:52:05 +0000] INFO: Ran execute[apt-get update]
successfully
[Sat, 10 Jul 2010 20:52:05 +0000] ERROR: Running exception handlers
[Sat, 10 Jul 2010 20:52:05 +0000] ERROR: Exception handlers complete
[Sat, 10 Jul 2010 20:52:05 +0000] ERROR: Re-raising exception: RuntimeError

  • can’t add a new key into hash during iteration
    /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/language.rb:41:in
    []=' /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/language.rb:41:inblock (2 levels) in value_for_platform’
    /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/language.rb:41:in
    each' /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/language.rb:41:inblock in value_for_platform’
    /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/language.rb:39:in
    each_pair' /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/language.rb:39:invalue_for_platform’
    /root/chef-tc/cookbooks/mysql/recipes/client.rb:23:in block in from_file' /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/recipe_definition_dsl_core.rb:71:ininstance_eval’
    /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/recipe_definition_dsl_core.rb:71:in
    method_missing' /root/chef-tc/cookbooks/mysql/recipes/client.rb:20:infrom_file’
    /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/from_file.rb:30:in
    instance_eval' /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/from_file.rb:30:infrom_file’
    /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/cookbook_version.rb:316:in
    load_recipe' /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/language_include_recipe.rb:40:inblock in include_recipe’
    /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/language_include_recipe.rb:27:in
    each' /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/mixin/language_include_recipe.rb:27:ininclude_recipe’
    /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/run_context.rb:93:in
    block in load' /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/run_context.rb:90:ineach’
    /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/run_context.rb:90:in
    load' /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/run_context.rb:54:ininitialize’
    /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/client.rb:83:in
    new' /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/client.rb:83:inrun’
    /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/application/solo.rb:193:in
    block in run_application' /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/application/solo.rb:185:inloop’
    /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/application/solo.rb:185:in
    run_application' /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/lib/chef/application.rb:62:inrun’
    /usr/local/lib/ruby/gems/1.9.1/gems/chef-0.9.6/bin/chef-solo:25:in <top (required)>' /usr/local/bin/chef-solo:19:inload’


@tommychheng
Programmer and UC Irvine Graduate Student
Find a great grad school based on research interests:
http://gradschoolnow.com


Opscode, Inc.
Adam Jacob, CTO
T: (206) 508-7449 E: adam@opscode.com