chef / chef/chef-server

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

Open
#987 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component: others Status: Adopted Triage: Confirmed
Dominant language
Erlang
Stars
303
Forks
211
Avg merge
1d 8h
Merged PRs (30d)
5

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the full chef-server-ctl reconfigure output and the traceback at chef_server_data_bootstrap.rb:97, following the call from recipes/bootstrap.rb and ec_postgres.rb. Compare the bootstrap behavior between Chef Server 12.9.1 and 12.8.0 after the documented cleanse and reconfigure steps; done means the cause is identified and the initial reconfigure no longer raises this error.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, postgresql, ruby
Domain
backend, databases, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.