chef / chef-server

Chef Infra Server is a hub for configuration data; storing cookbooks, node policies and metadata of managed nodes.
https://www.chef.io/chef/
Apache License 2.0
290 stars 210 forks source link

Unable to perform initial `chef-server-ctl reconfigure` on Debian 9.5 using 12.17.33 #1546

Closed rhass closed 6 years ago

rhass commented 6 years ago

Expected Behavior

The expected behavior is for chef-server-ctl reconfigure to succeed. This may affect other versions of Debian as well -- more testing is required.

Current Behavior

The initial chef-server-ctl reconfigure fails with the following error:

Recipe: private-chef::log_cleanup
  * file[/etc/cron.d/opc_log_cleanup] action delete (up to date)
  * file[/etc/cron.d/opc_logrotate.cron] action delete (up to date)
  * template[/etc/opscode/logrotate.conf] action create
    - create new file /etc/opscode/logrotate.conf
    - update content in file /etc/opscode/logrotate.conf from none to 134283
    --- /etc/opscode/logrotate.conf 2018-08-15 18:38:32.953755184 +0000
    +++ /etc/opscode/.chef-logrotate20180815-3520-bhz0al.conf   2018-08-15 18:38:32.953755184 +0000
    @@ -1 +1,5 @@
    +missingok
    +compress
    +notifempty
    +include /etc/opscode/logrotate.d
    - change mode from '' to '0644'
    - change owner from '' to 'root'
    - change group from '' to 'root'
  * template[/etc/cron.hourly/opc_logrotate] action create
    * Parent directory /etc/cron.hourly does not exist.
    ================================================================================
    Error executing action `create` on resource 'template[/etc/cron.hourly/opc_logrotate]'
    ================================================================================

    Chef::Exceptions::EnclosingDirectoryDoesNotExist
    ------------------------------------------------
    Parent directory /etc/cron.hourly does not exist.

    Resource Declaration:
    ---------------------
    # In /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/log_cleanup.rb

     35: template "/etc/cron.hourly/opc_logrotate" do
     36:   source "opc_logrotate.cron"
     37:   mode   "0755"
     38:   owner  "root"
     39:   group  "root"
     40: end

    Compiled Resource:
    ------------------
    # Declared in /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/log_cleanup.rb:35:in `from_file'

    template("/etc/cron.hourly/opc_logrotate") do
      action [:create]
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      source "opc_logrotate.cron"
      declared_type :template
      cookbook_name "private-chef"
      recipe_name "log_cleanup"
      mode "0755"
      owner "root"
      group "root"
      path "/etc/cron.hourly/opc_logrotate"
      verifications []
    end

    System Info:
    ------------
    chef_version=12.21.31
    platform=debian
    platform_version=9.5
    ruby=ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-linux]
    program_name=/opt/opscode/embedded/bin/chef-client
    executable=/opt/opscode/embedded/bin/chef-client

Recipe: private-chef::postgresql
  * runit_service[postgresql] action restart (up to date)
  * execute[restart_postgresql_log_service] action run
    - execute /opt/opscode/embedded/bin/sv restart /opt/opscode/sv/postgresql/log
Recipe: private-chef::oc_bifrost
  * runit_service[oc_bifrost] action restart (up to date)
  * execute[restart_oc_bifrost_log_service] action run
    - execute /opt/opscode/embedded/bin/sv restart /opt/opscode/sv/oc_bifrost/log
Recipe: private-chef::oc_id
  * runit_service[oc_id] action restart (up to date)
  * execute[restart_oc_id_log_service] action run
    - execute /opt/opscode/embedded/bin/sv restart /opt/opscode/sv/oc_id/log
Recipe: private-chef::nginx
  * runit_service[nginx] action restart (up to date)
Recipe: private-chef::opscode-solr4
  * runit_service[opscode-solr4] action restart (up to date)
  * execute[restart_opscode-solr4_log_service] action run
    - execute /opt/opscode/embedded/bin/sv restart /opt/opscode/sv/opscode-solr4/log
Recipe: private-chef::opscode-expander
  * runit_service[opscode-expander] action restart (up to date)
  * execute[restart_opscode-expander_log_service] action run
    - execute /opt/opscode/embedded/bin/sv restart /opt/opscode/sv/opscode-expander/log
Recipe: private-chef::bookshelf
  * runit_service[bookshelf] action restart (up to date)
  * execute[restart_bookshelf_log_service] action run
    - execute /opt/opscode/embedded/bin/sv restart /opt/opscode/sv/bookshelf/log
Recipe: private-chef::opscode-erchef
  * runit_service[opscode-erchef] action restart (up to date)
  * execute[restart_opscode-erchef_log_service] action run
    - execute /opt/opscode/embedded/bin/sv restart /opt/opscode/sv/opscode-erchef/log
Recipe: <Dynamically Defined Resource>
  * service[opscode-erchef] action restart
    - restart service service[opscode-erchef]
Recipe: private-chef::partybus
  * execute[set initial migration level] action run

    ================================================================================
    Error executing action `run` on resource 'execute[set initial migration level]'
    ================================================================================

    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.4.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.4.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

    Resource Declaration:
    ---------------------
    # In /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/partybus.rb

     47: execute "set initial migration level" do
     48:   action :nothing
     49:   command "cd /opt/opscode/embedded/service/partybus && ./bin/partybus init"
     50:   subscribes :run, "file[#{OmnibusHelper.bootstrap_sentinel_file}]", :delayed
     51: end
     52: 

    Compiled Resource:
    ------------------
    # Declared in /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/partybus.rb:47:in `from_file'

    execute("set initial migration level") do
      action [:nothing]
      retries 0
      retry_delay 2
      default_guard_interpreter :execute
      command "cd /opt/opscode/embedded/service/partybus && ./bin/partybus init"
      backup 5
      returns 0
      user nil
      declared_type :execute
      cookbook_name "private-chef"
      recipe_name "partybus"
    end

    System Info:
    ------------
    chef_version=12.21.31
    platform=debian
    platform_version=9.5
    ruby=ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-linux]
    program_name=/opt/opscode/embedded/bin/chef-client
    executable=/opt/opscode/embedded/bin/chef-client

Recipe: private-chef::opscode-chef-mover
  * execute[restart_opscode-chef-mover_log_service] action run
    - execute /opt/opscode/embedded/bin/sv restart /opt/opscode/sv/opscode-chef-mover/log
Recipe: private-chef::redis_lb
  * execute[restart_redis_lb_log_service] action run
    - execute /opt/opscode/embedded/bin/sv restart /opt/opscode/sv/redis_lb/log
Recipe: private-chef::nginx
  * execute[restart_nginx_log_service] action run
    - execute /opt/opscode/embedded/bin/sv restart /opt/opscode/sv/nginx/log
Recipe: private-chef::rabbitmq
  * execute[restart_rabbitmq_log_service] action run
    - execute /opt/opscode/embedded/bin/sv restart /opt/opscode/sv/rabbitmq/log
  * runit_service[rabbitmq] action restart (up to date)

Running handlers:
Running handlers complete
Chef Client failed. 484 resources updated in 03 minutes 28 seconds
[2018-08-15T18:38:52+00:00] FATAL: Stacktrace dumped to /var/opt/opscode/local-mode-cache/chef-stacktrace.out
[2018-08-15T18:38:52+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-08-15T18:38:52+00:00] FATAL: Chef::Exceptions::MultipleFailures: Multiple failures occurred:
* Chef::Exceptions::EnclosingDirectoryDoesNotExist occurred in chef run: template[/etc/cron.hourly/opc_logrotate] (private-chef::log_cleanup line 35) had an error: Chef::Exceptions::EnclosingDirectoryDoesNotExist: Parent directory /etc/cron.hourly does not exist.
* Mixlib::ShellOut::ShellCommandFailed occurred in delayed notification: execute[set initial migration level] (private-chef::partybus line 47) 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.4.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.4.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

Steps to Reproduce (for bugs)

  1. Create a Debian 9.5 instance.
  2. Download chef-server 12.17.33: wget https://packages.chef.io/files/stable/chef-server/12.17.33/ubuntu/16.04/chef-server-core_12.17.33-1_amd64.deb
  3. Install the debian package: dpkg -i chef-server-core_12.17.33-1_amd64.deb
  4. Run chef-server-ctl reconfigure

Your Environment

rhass commented 6 years ago

I confirmed this issue affects Debian 8 as well. (Debian 7 is too old as it has glibc 2.13 and we require 2.14 or later.)

markan commented 6 years ago

Like #1574 we cannot reproduce this outside of LXC. Ubuntu 18.04,16.04 appear to work fine in AWS.