chef / chef/chef-server

sudo chef-server-ctl reconfigure on Ubuntu 18.04 failed

Open
#1,641 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Good First Issue Triage: Confirmed Triage: Feature Request Type: Bug
Dominant language
Erlang
Stars
303
Forks
211
Avg merge
1d 8h
Merged PRs (30d)
5

Description

I'm trying to install chef-server on a Ubuntu 18.04 instance, but it failes:

wget https://packages.chef.io/files/stable/chef-server/12.19.31/ubuntu/18.04/chef-server-core_12.19.31-1_amd64.deb

sudo dpkg -i chef-server-core_12.19.31-1_amd64.deb
sudo chef-server-ctl reconfigure

Full output: https://gist.github.com/stephanvierkant/04791b5d28185ebd603920f131723556

Chef Client failed. 341 resources updated in 02 minutes 05 seconds
[2019-03-13T10:07:27+00:00] FATAL: Stacktrace dumped to /var/opt/opscode/local-mode-cache/chef-stacktrace.out
[2019-03-13T10:07:27+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2019-03-13T10:07:27+00:00] FATAL: Chef::Exceptions::MultipleFailures: Multiple failures occurred:
* TypeError occurred in chef run: openssl_x509_certificate[/var/opt/opscode/nginx/ca/.crt] (private-chef::nginx line 77) had an error: TypeError: no implicit conversion of nil into String
* Mixlib::ShellOut::ShellCommandFailed occurred in delayed notification: runit_service[nginx] (private-chef::nginx line 37) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /opt/opscode/embedded/bin/sv restart /opt/opscode/service/nginx ----
STDOUT: fail: /opt/opscode/service/nginx: unable to change to service directory: file does not exist
STDERR: 
---- End output of /opt/opscode/embedded/bin/sv restart /opt/opscode/service/nginx ----
Ran /opt/opscode/embedded/bin/sv restart /opt/opscode/service/nginx returned 1
* Mixlib::ShellOut::ShellCommandFailed occurred in delayed notification: execute[set initial migration level] (private-chef::partybus line 59) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of cd /opt/opscode/embedded/service/partybus && ./bin/partybus init ----
STDOUT: 
STDERR: /opt/opscode/embedded/service/gem/ruby/2.5.0/gems/sequel-3.34.1/lib/sequel/database/schema_generator.rb:19: warning: constant ::Fixnum is deprecated
/opt/opscode/embedded/service/gem/ruby/2.5.0/gems/sequel-3.34.1/lib/sequel/database/schema_generator.rb:19: warning: constant ::Bignum is deprecated
./bin/partybus:11:in `require': cannot load such file -- /opt/opscode/embedded/service/partybus/config.rb (LoadError)
        from ./bin/partybus:11:in `<main>'
---- End output of cd /opt/opscode/embedded/service/partybus && ./bin/partybus init ----
Ran cd /opt/opscode/embedded/service/partybus && ./bin/partybus init returned 1

================================================================================
   Error executing action `create` on resource 'openssl_x509_certificate[/var/opt/opscode/nginx/ca/.crt]'
   ================================================================================
   
   TypeError
   ---------
   no implicit conversion of nil into String
   
   Resource Declaration:
   ---------------------
   # In /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/nginx.rb
   
    77:    openssl_x509_certificate ssl_crtfile do
    78:      common_name server_name
    79:      org node['private_chef']['nginx']['ssl_company_name']
    80:      org_unit node['private_chef']['nginx']['ssl_organizational_unit_name']
    81:      country node['private_chef']['nginx']['ssl_country_name']
    82:      key_length node['private_chef']['nginx']['ssl_key_length']
    83:      expire node['private_chef']['nginx']['ssl_duration']
    84:      subject_alt_name [ "#{server_name_type}:#{server_name}" ]
    85:      owner OmnibusHelper.new(node).ownership['owner']
    86:      group OmnibusHelper.new(node).ownership['group']
    87:      mode '0600'
    88:    end
    89: 

This is caused by not having a hostname set. I think a better error message should be given here.

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 /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/nginx.rb at line 77 and reproduce the failure with chef-server-ctl reconfigure on Ubuntu 18.04 without a hostname. Trace the hostname-related failure and verify that reconfigure reports a clearer error explaining the missing hostname.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby, ubuntu
Domain
backend, infrastructure
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.