Chef-solo apche2 on centos 6.5 not working


#1

Hi,

I’m trying to deploy apache2 cookbook on centos 6.5 its CHEF-SOLO my role is
not executing please help me out!
Role:
{“name”: “apache2-jS5V1-Role”,“description”:“apache2-jS5V1-Role - created by
ITapp”,“default_attributes”:{},“override_attributes”:{“apache”:{“dir”:"/etc/httpd",“log_dir”:"/var/log/httpd",“listen_ports”:[“80”,“443”],“user”:“apache”}},“json_class”:“Chef::Role”,“chef_type”:“role”,“run_list”:[“recipe[apache2]”]}

Stack Trace:

[2014-06-23T02:22:13-04:00] WARN: *****************************************
[2014-06-23T02:22:13-04:00] WARN: Did not find config file: /etc/chef/solo.rb,
using command line options.
[2014-06-23T02:22:13-04:00] WARN: *****************************************
[2014-06-23T02:22:13-04:00] INFO: Forking chef instance to converge…
[2014-06-23T02:22:13-04:00] DEBUG: Fork successful. Waiting for new chef pid:
12614
[2014-06-23T02:22:13-04:00] DEBUG: Forked instance now converging
Starting Chef Client, version 11.12.8
[2014-06-23T02:22:13-04:00] INFO: *** Chef 11.12.8 ***
[2014-06-23T02:22:13-04:00] INFO: Chef-client pid: 12614
[2014-06-23T02:22:13-04:00] DEBUG: Chef-client request_id:
ddfdf845-5a0d-4884-ba79-72ed18a821b7
[2014-06-23T02:22:15-04:00] DEBUG: Building node object for a01admin700
[2014-06-23T02:22:15-04:00] DEBUG: Extracting run list from JSON attributes
provided on command line
[2014-06-23T02:22:15-04:00] DEBUG: Re-raising exception: NoMethodError -
undefined method delete' for role[apache2-jS5V1-Role]:Chef::Role /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/node.rb:330:inconsume_run_list’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/node.rb:307:in
`consume_attributes’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/node.rb:295:in
`consume_external_attrs’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/policy_builder/expand_node_object.rb:118:in
`build_node’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:259:in
`build_node’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:420:in
`do_run’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:213:in
`block in run’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:207:in
`fork’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:207:in
`run’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application.rb:217:in
`run_chef_client’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:221:in
`block in run_application’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:213:in
`loop’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:213:in
`run_application’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application.rb:67:in
run' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/bin/chef-solo:25:in<top (required)>’
/usr/bin/chef-solo:23:in load' /usr/bin/chef-solo:23:in
[2014-06-23T02:22:15-04:00] FATAL: Stacktrace dumped to
/var/chef/cache/chef-stacktrace.out
[2014-06-23T02:22:15-04:00] DEBUG: NoMethodError: undefined method delete' for role[apache2-jS5V1-Role]:Chef::Role /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/node.rb:330:inconsume_run_list’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/node.rb:307:in
consume_attributes' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/node.rb:295:inconsume_external_attrs’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/policy_builder/expand_node_object.rb:118:in
build_node' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:259:inbuild_node’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:420:in
do_run' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:213:inblock in run’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:207:in
fork' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:207:inrun’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application.rb:217:in
run_chef_client' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:221:inblock in run_application’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:213:in
loop' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:213:inrun_application’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application.rb:67:in
run' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/bin/chef-solo:25:in<top (required)>’
/usr/bin/chef-solo:23:in load' /usr/bin/chef-solo:23:in
Chef Client failed. 0 resources updated in 2.377110574 seconds
[2014-06-23T02:22:15-04:00] ERROR: undefined method `delete’ for
role[apache2-jS5V1-Role]:Chef::Role
[2014-06-23T02:22:15-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef
run process exited unsuccessfully (exit code 1)

Thanks
Venky


#2

How are you starting chef-solo? What does your chef-solo json file look like? It seems like you’re passing a role in with chef-solo -j my_role.json, which won’t work. You need to specify the run list in a json file that looks like this: http://docs.opscode.com/chef_solo.html#attributes


Daniel DeLeo

On Sunday, June 22, 2014 at 11:40 PM, venkiain@gmail.com wrote:

Hi,

I’m trying to deploy apache2 cookbook on centos 6.5 its CHEF-SOLO my role is
not executing please help me out!
Role:
{“name”: “apache2-jS5V1-Role”,“description”:“apache2-jS5V1-Role - created by
ITapp”,“default_attributes”:{},“override_attributes”:{“apache”:{“dir”:"/etc/httpd",“log_dir”:"/var/log/httpd",“listen_ports”:[“80”,“443”],“user”:“apache”}},“json_class”:“Chef::Role”,“chef_type”:“role”,“run_list”:[“recipe[apache2]”]}

Stack Trace:

[2014-06-23T02:22:13-04:00] WARN: *****************************************
[2014-06-23T02:22:13-04:00] WARN: Did not find config file: /etc/chef/solo.rb,
using command line options.
[2014-06-23T02:22:13-04:00] WARN: *****************************************
[2014-06-23T02:22:13-04:00] INFO: Forking chef instance to converge…
[2014-06-23T02:22:13-04:00] DEBUG: Fork successful. Waiting for new chef pid:
12614
[2014-06-23T02:22:13-04:00] DEBUG: Forked instance now converging
Starting Chef Client, version 11.12.8
[2014-06-23T02:22:13-04:00] INFO: *** Chef 11.12.8 ***
[2014-06-23T02:22:13-04:00] INFO: Chef-client pid: 12614
[2014-06-23T02:22:13-04:00] DEBUG: Chef-client request_id:
ddfdf845-5a0d-4884-ba79-72ed18a821b7
[2014-06-23T02:22:15-04:00] DEBUG: Building node object for a01admin700
[2014-06-23T02:22:15-04:00] DEBUG: Extracting run list from JSON attributes
provided on command line
[2014-06-23T02:22:15-04:00] DEBUG: Re-raising exception: NoMethodError -
undefined method delete' for role[apache2-jS5V1-Role]:Chef::Role /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/node.rb:330:inconsume_run_list’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/node.rb:307:in
`consume_attributes’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/node.rb:295:in
`consume_external_attrs’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/policy_builder/expand_node_object.rb:118:in
`build_node’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:259:in
`build_node’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:420:in
`do_run’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:213:in
`block in run’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:207:in
`fork’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:207:in
`run’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application.rb:217:in
`run_chef_client’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:221:in
`block in run_application’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:213:in
`loop’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:213:in
`run_application’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application.rb:67:in
run' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/bin/chef-solo:25:in<top (required)>’
/usr/bin/chef-solo:23:in load' /usr/bin/chef-solo:23:in
[2014-06-23T02:22:15-04:00] FATAL: Stacktrace dumped to
/var/chef/cache/chef-stacktrace.out
[2014-06-23T02:22:15-04:00] DEBUG: NoMethodError: undefined method delete' for role[apache2-jS5V1-Role]:Chef::Role /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/node.rb:330:inconsume_run_list’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/node.rb:307:in
consume_attributes' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/node.rb:295:inconsume_external_attrs’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/policy_builder/expand_node_object.rb:118:in
build_node' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:259:inbuild_node’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:420:in
do_run' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:213:inblock in run’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:207:in
fork' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:207:inrun’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application.rb:217:in
run_chef_client' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:221:inblock in run_application’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:213:in
loop' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:213:inrun_application’
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application.rb:67:in
run' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/bin/chef-solo:25:in<top (required)>’
/usr/bin/chef-solo:23:in load' /usr/bin/chef-solo:23:in
Chef Client failed. 0 resources updated in 2.377110574 seconds
[2014-06-23T02:22:15-04:00] ERROR: undefined method `delete’ for
role[apache2-jS5V1-Role]:Chef::Role
[2014-06-23T02:22:15-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef
run process exited unsuccessfully (exit code 1)

Thanks
Venky


#3

we have system that auto generates role and its like this {“name”:
“apache2-jS5V1-Role”,“
description”:“apache2-jS5V1-Role - created by
ITapp”,“default_attributes”:{},“override_attributes”:{“apache”:{“dir”:"/etc/httpd",“log_dir”:"/var/log/httpd",“listen_ports”:[“80”,“443”],“user”:“apache”}},“json_class”:“Chef::Role”,“chef_type”:“role”,“run_list”:[“recipe[apache2]”]}

This role works in ubuntu but not in centos

On Tue, Jun 24, 2014 at 11:51 PM, Daniel DeLeo dan@kallistec.com wrote:

How are you starting chef-solo? What does your chef-solo json file look
like? It seems like you’re passing a role in with chef-solo -j my_role.json, which won’t work. You need to specify the run list in a json
file that looks like this:
http://docs.opscode.com/chef_solo.html#attributes


Daniel DeLeo

On Sunday, June 22, 2014 at 11:40 PM, venkiain@gmail.com wrote:

Hi,

I’m trying to deploy apache2 cookbook on centos 6.5 its CHEF-SOLO my
role is
not executing please help me out!
Role:
{“name”: “apache2-jS5V1-Role”,“description”:"apache2-jS5V1-Role -
created by

ITapp",“default_attributes”:{},“override_attributes”:{“apache”:{“dir”:"/etc/httpd",“log_dir”:"/var/log/httpd",“listen_ports”:[“80”,“443”],“user”:“apache”}},“json_class”:“Chef::Role”,“chef_type”:“role”,“run_list”:[“recipe[apache2]”]}

Stack Trace:

[2014-06-23T02:22:13-04:00] WARN:


[2014-06-23T02:22:13-04:00] WARN: Did not find config file:
/etc/chef/solo.rb,
using command line options.
[2014-06-23T02:22:13-04:00] WARN:


[2014-06-23T02:22:13-04:00] INFO: Forking chef instance to converge…
[2014-06-23T02:22:13-04:00] DEBUG: Fork successful. Waiting for new chef
pid:
12614
[2014-06-23T02:22:13-04:00] DEBUG: Forked instance now converging
Starting Chef Client, version 11.12.8
[2014-06-23T02:22:13-04:00] INFO: *** Chef 11.12.8 ***
[2014-06-23T02:22:13-04:00] INFO: Chef-client pid: 12614
[2014-06-23T02:22:13-04:00] DEBUG: Chef-client request_id:
ddfdf845-5a0d-4884-ba79-72ed18a821b7
[2014-06-23T02:22:15-04:00] DEBUG: Building node object for a01admin700
[2014-06-23T02:22:15-04:00] DEBUG: Extracting run list from JSON
attributes
provided on command line
[2014-06-23T02:22:15-04:00] DEBUG: Re-raising exception: NoMethodError -
undefined method `delete’ for role[apache2-jS5V1-Role]:Chef::Role

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/node.rb:330:in

`consume_run_list’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/node.rb:307:in

`consume_attributes’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/node.rb:295:in

`consume_external_attrs’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/policy_builder/expand_node_object.rb:118:in

`build_node’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:259:in

`build_node’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:420:in

`do_run’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:213:in

`block in run’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:207:in

`fork’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:207:in

`run’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application.rb:217:in

`run_chef_client’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:221:in

`block in run_application’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:213:in

`loop’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:213:in

`run_application’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application.rb:67:in

`run’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/bin/chef-solo:25:in

<top (required)>' /usr/bin/chef-solo:23:inload’
/usr/bin/chef-solo:23:in <main>' [2014-06-23T02:22:15-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out [2014-06-23T02:22:15-04:00] DEBUG: NoMethodError: undefined methoddelete’ for
role[apache2-jS5V1-Role]:Chef::Role

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/node.rb:330:in

`consume_run_list’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/node.rb:307:in

`consume_attributes’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/node.rb:295:in

`consume_external_attrs’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/policy_builder/expand_node_object.rb:118:in

`build_node’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:259:in

`build_node’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:420:in

`do_run’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:213:in

`block in run’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:207:in

`fork’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:207:in

`run’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application.rb:217:in

`run_chef_client’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:221:in

`block in run_application’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:213:in

`loop’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:213:in

`run_application’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application.rb:67:in

`run’

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/bin/chef-solo:25:in

<top (required)>' /usr/bin/chef-solo:23:inload’
/usr/bin/chef-solo:23:in <main>' Chef Client failed. 0 resources updated in 2.377110574 seconds [2014-06-23T02:22:15-04:00] ERROR: undefined methoddelete’ for
role[apache2-jS5V1-Role]:Chef::Role
[2014-06-23T02:22:15-04:00] FATAL: Chef::Exceptions::ChildConvergeError:
Chef
run process exited unsuccessfully (exit code 1)

Thanks
Venky