Installing Chef on Ubuntu - opscode-reporting-ctl: command not found

Hello Everyone,

I am following along with the beginner tutorials and I am attempting to stand up a virtualbox Ubuntu 14.04.01 Chef Server.

When I get to the part the asks us to run “sudo opscode-reporting-ctl reconfigure”

I get the following error:

sudo: opscode-reporting-ctl: command not found.

On the server I have ran the following commands:

  1. curl -L https://omnitruck.chef.io/install.sh | sudo bash -s – -P chef-server

  2. sudo nano /etc/opscode/chef-server.rb

Setup the config file in step 2…

  1. sudo chef-server-ctl reconfigure

Any help??

Has anyone experienced this problem?.. Kind of at a loss here. I build the server twice following the basic tutorials and still having the same issue.

Can you provide a link to the tutorial that you are following?

Sure! This is the tutorial:

https://learn.chef.io/install-and-manage-your-own-chef-server/linux/install-chef-server/install-chef-server-using-your-hardware/#step1

I run into trouble on the last part of Step 5 when installing the reporting feature…

Did you run sudo chef-server-ctl install opscode-reporting ? Did it fail?

Ok it looks like it fails..

NoMethodError

undefined method `url' for :Array

Cookbook Trace:

/var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/add_ons_wrapper.rb:58:in block in from_file' /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/add_ons_wrapper.rb:51:in each'
/var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/add_ons_wrapper.rb:51:in `from_file'

Relevant File Content:

/var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/add_ons_wrapper.rb:

51: node['private_chef']['addons']['packages'].each do |pkg|
52: artifact_info = Mixlib::Install.new(
53: channel: :stable,
54: product_name: pkg.split(/(chef-|opscode-)(.*)/).last,
55: product_version: :latest,
56: ).detect_platform.artifact_info
57:
58>> pkg_file = File.join(addon_path, File.basename(artifact_info.url))
59:
60: remote_file pkg_file do
61: source artifact_info.url
62: checksum artifact_info.sha256
63: end
64: end
65: else
66: addon_path = node['private_chef']['addons']['path']
67: end

Platform:

x86_64-linux

Running handlers:

  • #Class:0x000000072d3848::AddonInstallHandler
    Running handlers complete
    Chef Client failed. 0 resources updated in 02 seconds
    [2016-09-22T11:14:26-04:00] FATAL: Stacktrace dumped to /var/opt/opscode/local-mode-cache/chef-stacktrace.out
    [2016-09-22T11:14:26-04:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
    [2016-09-22T11:14:26-04:00] FATAL: NoMethodError: undefined method `url' for :Array

This is the log file:

paulh@ChefServer:~$ sudo cat /var/opt/opscode/local-mode-cache/chef-stacktrace.out
Generated at 2016-09-22 11:10:27 -0400
NoMethodError: undefined method url' for []:Array /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/add_ons_wrapper.rb:58:in block in from_file'
/var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/add_ons_wrapper.rb:51:in each' /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/add_ons_wrapper.rb:51:in from_file'
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.19/lib/chef/mixin/from_file.rb:30:in instance_eval' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.19/lib/chef/mixin/from_file.rb:30:in from_file'
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.19/lib/chef/cookbook_version.rb:233:in load_recipe' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.19/lib/chef/run_context.rb:354:in load_recipe'
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.19/lib/chef/run_context/cookbook_compiler.rb:140:in block in compile_recipes' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.19/lib/chef/run_context/cookbook_compiler.rb:138:in each'
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.19/lib/chef/run_context/cookbook_compiler.rb:138:in compile_recipes' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.19/lib/chef/run_context/cookbook_compiler.rb:75:in compile'
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.19/lib/chef/run_context.rb:176:in load' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.19/lib/chef/policy_builder/expand_node_object.rb:97:in setup_run_context'
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.19/lib/chef/client.rb:510:in setup_run_context' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.19/lib/chef/client.rb:280:in run'
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.19/lib/chef/application.rb:268:in run_with_graceful_exit_option' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.19/lib/chef/application.rb:244:in block in run_chef_client'
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.19/lib/chef/local_mode.rb:44:in with_server_connectivity' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.19/lib/chef/application.rb:227:in run_chef_client'
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.19/lib/chef/application/client.rb:419:in run_application' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.19/lib/chef/application.rb:59:in run'
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.19/bin/chef-client:26:in <top (required)>' /opt/opscode/embedded/bin/chef-client:23:in load'
/opt/opscode/embedded/bin/chef-client:23:in `'paulh@ChefServer:~$

I believe I fixed one error. I hadn’t removed AppArmor. I have uninstall apparmor and started over, but now I am running into the following error when I run the “chef-server-ctl install opscode-reporting” command:

Recipe Compile Error in /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/add_ons_wrapper.rb

Has anyone encountered this error?

I found a work-around. I needed to download the *.deb package for opscode-reporting-ctl from this site and install it that way:

https://downloads.chef.io/reporting/ubuntu/

Now I am able to add the reporting feature and reconfigure it. Hopes this helps someone else.

Paul