bloomberg / vault-cluster-cookbook

Application cookbook which installs and configures Vault with Consul as a backend.
Other
15 stars 23 forks source link

Ubuntu 14.04 service fails to start: undocumented chef-vault dependency #13

Open hedgehog opened 7 years ago

hedgehog commented 7 years ago

On ubuntu 14.04, running:

include_recipe 'consul-cluster::default'

yields

==> lcl:       Compiled Resource:
==> lcl:       ------------------
==> lcl:       # Declared in /var/chef/cache/cookbooks/consul/recipes/default.rb:56:in `from_file'
==> lcl:       
==> lcl:       poise_service("consul") do
==> lcl:         action [:enable]
==> lcl:         retries 0
==> lcl:         retry_delay 2
==> lcl:         default_guard_interpreter :default
==> lcl:         service_name "consul"
==> lcl:         command "/opt/consul/0.7.0/consul agent -config-file=/etc/consul/consul.json -config-dir=/etc/consul/conf.d"
==> lcl:         directory "/var/lib/consul"
==> lcl:         user "consul"
==> lcl:         environment {"GOMAXPROCS"=>"2", "PATH"=>"/usr/local/bin:/usr/bin:/bin"}
==> lcl:         options_systemd {"template"=>"consul:systemd.service.erb"}
==> lcl:         options_sysvinit {"template"=>"consul:sysvinit.service.erb"}
==> lcl:         options_upstart {"template"=>"consul:upstart.service.erb", "executable"=>"/opt/consul/0.7.0/consul"}
==> lcl:       end
==> lcl:       
==> lcl:       Platform:
==> lcl:       ---------
==> lcl:       x86_64-linux
==> lcl:       
==> lcl:     
==> lcl:     
==> lcl: ================================================================================
==> lcl:     
==> lcl: Error executing action `restart` on resource 'consul_service[consul]'
==> lcl:     
==> lcl: ================================================================================
==> lcl: 
==> lcl:     
==> lcl:     Mixlib::ShellOut::ShellCommandFailed
==> lcl:     ------------------------------------
==> lcl:     poise_service[consul] (/var/chef/cache/cookbooks/consul/recipes/default.rb line 56) had an error: Mixlib::ShellOut::ShellCommandFailed: service[consul] (/var/chef/cache/cookbooks/consul/recipes/default.rb line 56) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
==> lcl:     ---- Begin output of /sbin/start consul ----
==> lcl:     STDOUT: 
==> lcl:     STDERR: start: Unknown job: consul
==> lcl:     ---- End output of /sbin/start consul ----
==> lcl:     Ran /sbin/start consul returned 1
==> lcl:     
==> lcl:     Cookbook Trace:
==> lcl:     ---------------
==> lcl:     /var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_providers/base.rb:74:in `block in action_start'
==> lcl:     /var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_providers/base.rb:134:in `notify_if_service'
==> lcl:     /var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_providers/base.rb:73:in `action_start'
==> lcl:     /var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_providers/upstart.rb:45:in `action_restart'
==> lcl:     /var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_mixin.rb:125:in `block in action_restart'
==> lcl:     /var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_mixin.rb:154:in `notify_if_service'
==> lcl:     /var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_mixin.rb:124:in `action_restart'
==> lcl:     
==> lcl:     
==> lcl: Resource Declaration:
==> lcl:     
==> lcl: ---------------------
==> lcl: 
==> lcl:     # In /var/chef/cache/cookbooks/consul/recipes/default.rb
==> lcl:     
==> lcl:      56: consul_service service_name do |r|
==> lcl:      57:   version node['consul']['version']
==> lcl:      58:   config_file config.path
==> lcl:      59:   program install.consul_program
==> lcl:      60: 
==> lcl:      61:   unless windows?
==> lcl:      62:     user node['consul']['service_user']
==> lcl:      63:     group node['consul']['service_group']
==> lcl:      64:   end
==> lcl:      65:   if node['consul']['service']
==> lcl:     
==> lcl:     Compiled Resource:
==> lcl:     ------------------
==> lcl:     # Declared in /var/chef/cache/cookbooks/consul/recipes/default.rb:56:in `from_file'
==> lcl:     
==> lcl:     consul_service("consul") do
==> lcl:       action [:enable]
==> lcl:       retries 0
==> lcl:       retry_delay 2
==> lcl:       default_guard_interpreter :default
==> lcl:       declared_type :consul_service
==> lcl:       cookbook_name "consul"
==> lcl:       recipe_name "default"
==> lcl:       config_file "/etc/consul/consul.json"
==> lcl:       program "/opt/consul/0.7.0/consul"
==> lcl:       user "consul"
==> lcl:       group "consul"
==> lcl:       config_dir "/etc/consul/conf.d"
==> lcl:       nssm_params {"AppDirectory"=>"/var/lib/consul", "AppStdout"=>"/etc/consul/stdout.log", "AppStderr"=>"/etc/consul/error.log", "AppRotateFiles"=>1, "AppRotateOnline"=>1, "AppRotateBytes"=>20000000}
==> lcl:       service_name "consul"
==> lcl:       data_dir "/var/lib/consul"
==> lcl:       environment {"GOMAXPROCS"=>"2", "PATH"=>"/usr/local/bin:/usr/bin:/bin"}
==> lcl:     end
==> lcl:     
==> lcl:     Platform:
==> lcl:     ---------
==> lcl:     x86_64-linux
==> lcl:     
==> lcl: [2016-12-11T05:34:35+00:00] INFO: ruby_block[save-sysctl-params] sending create action to template[/etc/sysctl.d/99-chef-attributes.conf] (delayed)
==> lcl: Recipe: sysctl::default
==> lcl:   
==> lcl: * template[/etc/sysctl.d/99-chef-attributes.conf] action create
==> lcl:  (up to date)
==> lcl: Running handlers:
==> lcl: [2016-12-11T05:34:35+00:00] ERROR: Running exception handlers
==> lcl: Running handlers complete
==> lcl: [2016-12-11T05:34:35+00:00] ERROR: Exception handlers complete
==> lcl: Chef Client failed. 16 resources updated in 01 minutes 20 seconds
==> lcl: [2016-12-11T05:34:35+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> lcl: [2016-12-11T05:34:35+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
==> lcl: [2016-12-11T05:34:35+00:00] ERROR: Chef::Exceptions::MultipleFailures
==> lcl: [2016-12-11T05:34:35+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

The stack trace below suggests this is related to a chef-vault dependency:

chef-stacktrace.out.txt

rlisewski commented 7 years ago

@hedgehog I had similar problem on CentOS, solved it by adding require 'chef-vault'

require 'chef-vault'
include_recipe 'consul-cluster::default'