Unable to use json roles in chef 11.12.2


#1

Hello. All works fine before i’m switching to json roles.
Now i have error like:

qemu: [2014-11-14T16:06:40+00:00] INFO: Setting the run_list to

[“role[role-base]”, “role[role-vm]”, “role[env-zone-00]”,
“role[env-role-base-00]”, “role[env-role-vm-00]”,
“role[env-node-vm00-00]”] from CLI options
qemu: [2014-11-14T16:06:40+00:00] DEBUG: Applying attributes from json file
qemu: [2014-11-14T16:06:40+00:00] DEBUG: Platform is exherbo version 3.14.23
qemu:
qemu: ================================================================================
qemu: Error expanding the run_list:
qemu: ================================================================================
qemu:
qemu: Unexpected Error:
qemu: -----------------
qemu: NoMethodError: undefined method run_list_for' for #<Array:0x0000000288a980> qemu: qemu: [2014-11-14T16:06:40+00:00] DEBUG: Re-raising exception: NoMethodError - undefined methodrun_list_for’ for
#Array:0x0000000288a980
qemu: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-11.16.0.alpha.0/lib/chef/run_list/run_list_expansion.rb:151:in
expand_run_list_items' qemu: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-11.16.0.alpha.0/lib/chef/run_list/run_list_expansion.rb:84:inexpand’
qemu: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-11.16.0.alpha.0/lib/chef/run_list.rb:139:in
expand' qemu: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-11.16.0.alpha.0/lib/chef/node.rb:361:inexpand!‘
qemu: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-11.16.0.alpha.0/lib/chef/policy_builder/expand_node_object.rb:135:in
expand_run_list' qemu: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-11.16.0.alpha.0/lib/chef/policy_builder/expand_node_object.rb:122:inbuild_node’
qemu: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-11.16.0.alpha.0/lib/chef/client.rb:259:in
build_node' qemu: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-11.16.0.alpha.0/lib/chef/client.rb:420:indo_run’
qemu: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-11.16.0.alpha.0/lib/chef/client.rb:213:in
block in run' qemu: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-11.16.0.alpha.0/lib/chef/client.rb:207:infork’
qemu: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-11.16.0.alpha.0/lib/chef/client.rb:207:in
run' qemu: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-11.16.0.alpha.0/lib/chef/application.rb:203:inblock in run_chef_client’
qemu: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-11.16.0.alpha.0/lib/chef/local_mode.rb:38:in
with_server_connectivity' qemu: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-11.16.0.alpha.0/lib/chef/application.rb:190:inrun_chef_client’
qemu: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-11.16.0.alpha.0/lib/chef/application/solo.rb:226:in
block in run_application' qemu: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-11.16.0.alpha.0/lib/chef/application/solo.rb:218:inloop’
qemu: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-11.16.0.alpha.0/lib/chef/application/solo.rb:218:in
run_application' qemu: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-11.16.0.alpha.0/lib/chef/application.rb:56:inrun’
qemu: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-11.16.0.alpha.0/bin/chef-solo:25:in
<top (required)>' qemu: /usr/bin/chef-solo:23:inload’
qemu: /usr/bin/chef-solo:23:in `’

I’m not using role inside role. Why this happening and how to solve this?


Vasiliy Tolstov,
e-mail: v.tolstov@selfip.ru
jabber: vase@selfip.ru


#2

On Friday, November 14, 2014 at 8:30 AM, Vasiliy Tolstov wrote:

Hello. All works fine before i’m switching to json roles.
Now i have error like:

qemu: [2014-11-14T16:06:40+00:00] INFO: Setting the run_list to
[“role[role-base]”, “role[role-vm]”, “role[env-zone-00]”,
“role[env-role-base-00]”, “role[env-role-vm-00]”,
“role[env-node-vm00-00]”] from CLI options
qemu: [2014-11-14T16:06:40+00:00] DEBUG: Applying attributes from json file
qemu: [2014-11-14T16:06:40+00:00] DEBUG: Platform is exherbo version 3.14.23
qemu:
qemu: ================================================================================
qemu: Error expanding the run_list:
qemu: ================================================================================
qemu:
qemu: Unexpected Error:
qemu: -----------------
qemu: NoMethodError: undefined method `run_list_for’ for
#Array:0x0000000288a980

You’re probably missing the json_class attribute. http://docs.getchef.com/essentials_roles.html#json


Daniel DeLeo


#3

Thanks,but im double check and in all roles i have this
14 нояб. 2014 г. 22:26 пользователь “Daniel DeLeo” dan@kallistec.com
написал:

On Friday, November 14, 2014 at 8:30 AM, Vasiliy Tolstov wrote:

Hello. All works fine before i’m switching to json roles.
Now i have error like:

qemu: [2014-11-14T16:06:40+00:00] INFO: Setting the run_list to
[“role[role-base]”, “role[role-vm]”, “role[env-zone-00]”,
“role[env-role-base-00]”, “role[env-role-vm-00]”,
“role[env-node-vm00-00]”] from CLI options
qemu: [2014-11-14T16:06:40+00:00] DEBUG: Applying attributes from json
file
qemu: [2014-11-14T16:06:40+00:00] DEBUG: Platform is exherbo version
3.14.23
qemu:
qemu:
================================================================================
qemu: Error expanding the run_list:
qemu:
================================================================================
qemu:
qemu: Unexpected Error:
qemu: -----------------
qemu: NoMethodError: undefined method `run_list_for’ for
#Array:0x0000000288a980

You’re probably missing the json_class attribute.
http://docs.getchef.com/essentials_roles.html#json


Daniel DeLeo


#4

2014-11-14 23:05 GMT+03:00 Vasiliy Tolstov v.tolstov@selfip.ru:

Thanks,but im double check and in all roles i have this

My mistake, i have error in json syntax.


Vasiliy Tolstov,
e-mail: v.tolstov@selfip.ru
jabber: vase@selfip.ru