chef-server icon indicating copy to clipboard operation
chef-server copied to clipboard

Error executing action `run` on resource 'ruby_block[bootstrap-chef-server-data]'

Open jeremymv2 opened this issue 9 years ago • 6 comments

Note from the Maintainers

If you experience this issue, can you:

  • Ensure that this was the first error that you experienced during the installation process.
  • Provide the full output of the chef-server-ctl reconfigure command.
  • Before trying an older version, attempt to run chef-server-ctl cleanse followed by chef-server-ctl reconfigure.

Apologies for any trouble this issue causes you and thank you in advance for any time you can spend providing more information.

Original Report

On a customer's fresh (but customized) RHEL 6.8 image, with no previous Chef Server installed, installing Chef Server 12.9.1 results in this on the initial reconfigure.

================================================================================
   Error executing action `run` on resource 'ruby_block[bootstrap-chef-server-data]'
   ================================================================================
   NoMethodError
   -------------
   undefined method `[]' for nil:NilClass
   Cookbook Trace:
   ---------------
   /var/opt/opscode/local-mode-cache/cookbooks/private-chef/libraries/chef_server_data_bootstrap.rb:97:in `create_superuser_in_erchef'
   /var/opt/opscode/local-mode-cache/cookbooks/private-chef/libraries/chef_server_data_bootstrap.rb:50:in `block in bootstrap'
   /var/opt/opscode/local-mode-cache/cookbooks/private-chef/libraries/ec_postgres.rb:55:in `block in with_service_connection'
   /var/opt/opscode/local-mode-cache/cookbooks/private-chef/libraries/ec_postgres.rb:44:in `with_connection'
   /var/opt/opscode/local-mode-cache/cookbooks/private-chef/libraries/ec_postgres.rb:52:in `with_service_connection'
   /var/opt/opscode/local-mode-cache/cookbooks/private-chef/libraries/chef_server_data_bootstrap.rb:49:in `bootstrap'
   /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/bootstrap.rb:35:in `block (2 levels) in from_file'
   Resource Declaration:
   ---------------------
   # In /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/bootstrap.rb
    33: ruby_block "bootstrap-chef-server-data" do
    34:   block do
    35:     ChefServerDataBootstrap.new(node).bootstrap
    36:   end
    37:   not_if { OmnibusHelper.has_been_bootstrapped? }
    38:   notifies :restart, 'service[opscode-erchef]'
    39: end
    40:
   Compiled Resource:
   ------------------
   # Declared in /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/bootstrap.rb:33:in `from_file'
   ruby_block("bootstrap-chef-server-data") do
     action [:run]
     retries 0
     retry_delay 2
     default_guard_interpreter :default
     block_name "bootstrap-chef-server-data"
     declared_type :ruby_block
     cookbook_name "private-chef"
     recipe_name "bootstrap"
     block #<Proc:0x0000000429f8e8@/var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/bootstrap.rb:34>
     not_if { #code block }
   end

We worked around the problem by running chef-server-ctl cleanse, rpm -e <chef-server rpm> and then installing Chef Server 12.8.0 and running reconfigure. The reconfigure of 12.8.0 ran successfully without issue.

jeremymv2 avatar Oct 28 '16 20:10 jeremymv2

Had the same issue with Chef Server 12.10.0 on CentOS 7. Installation of Chef Server 12.8.0 went smooth though.

konstantin-kelemen avatar Nov 03 '16 14:11 konstantin-kelemen

Exact same issue with 12.11 on CentOS 7 minimal. Reverted to 12.8, and was able to install.

innomation avatar Nov 15 '16 03:11 innomation

The proposed solution solved my server installation problem: "Before trying an older version, attempt to run chef-server-ctl cleanse followed by chef-server-ctl reconfigure." OS suse linux Leap 42.1 - Chef chef-server-core-12.11.1-1.el7.x86_64

bereti avatar Nov 29 '16 09:11 bereti

Same issue here, new install, fresh image. Linux chef-dev 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Ran cleans and reconfigure and it worked!

jacksonp2008 avatar Feb 16 '17 01:02 jacksonp2008

I had the same issue installing chef-server-core_12.13.0-1_amd64.deb on ubuntu 16.04 and running chef-server-ctl reconfigure. I got the following error: STDOUT: fail: /opt/opscode/service/nginx: unable to change to service directory: file does not exist

Aslan avatar Mar 03 '17 00:03 Aslan

I am also experiencing this on the Chef-HA-DRBD setup with chef-server-core-12.13.1.

Our organization hasn't updated to the Chef-HA-EEP setup yet (Elasticsearch, etcd, PostrgreSQL).

I bet doing an older install first of 12.7 or 12.8, then upgrading to 12.(anything newer) would work.

FilBot3 avatar Oct 11 '18 17:10 FilBot3