Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation fails with ERROR: service[consul] (consul::_service line 112) had an error: Chef::Exceptions::Service: service[consul]: unable to locate the init.d script! #33

Closed
nickapos opened this issue Aug 7, 2014 · 4 comments

Comments

@nickapos
Copy link

nickapos commented Aug 7, 2014

This happens on centos 6.5
It seems that the error is caused by the installation of the json file inside the _services.rb file just before the installation of the service itself.
If the jsonfile block is moved after the service installation block then the error dissapears

@brandocorp
Copy link
Contributor

I also just ran into this issue on CenOS 6.5. Here are my Vagrant logs:

==> bootstrap: Chef 11.14.6 Omnibus package is already installed.
==> bootstrap: Running provisioner: chef_solo...
Generating chef JSON and uploading...
==> bootstrap: Running chef-solo...
==> bootstrap: [2014-08-20T19:11:47+00:00] INFO: Forking chef instance to converge...
==> bootstrap: [2014-08-20T19:11:47+00:00] WARN:
==> bootstrap: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
==> bootstrap: SSL validation of HTTPS requests is disabled. HTTPS connections are still
==> bootstrap: encrypted, but chef is not able to detect forged replies or man in the middle
==> bootstrap: attacks.
==> bootstrap:
==> bootstrap: To fix this issue add an entry like this to your configuration file:
==> bootstrap:
==> bootstrap: ```
==> bootstrap:   # Verify all HTTPS connections (recommended)
==> bootstrap:   ssl_verify_mode :verify_peer
==> bootstrap:
==> bootstrap:   # OR, Verify only connections to chef-server
==> bootstrap:   verify_api_cert true
==> bootstrap: ```
==> bootstrap:
==> bootstrap: To check your SSL configuration, or troubleshoot errors, you can use the
==> bootstrap: `knife ssl check` command like so:
==> bootstrap:
==> bootstrap: ```
==> bootstrap:   knife ssl check -c /tmp/vagrant-chef-3/solo.rb
==> bootstrap: ```
==> bootstrap:
==> bootstrap: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
==> bootstrap: [2014-08-20T19:11:47+00:00] INFO: *** Chef 11.14.6 ***
==> bootstrap: [2014-08-20T19:11:47+00:00] INFO: Chef-client pid: 4266
==> bootstrap: [2014-08-20T19:11:54+00:00] INFO: Setting the run_list to ["recipe[consul::default]", "recipe[consul::ui]"] from CLI options
==> bootstrap: [2014-08-20T19:11:54+00:00] INFO: Run List is [recipe[consul::default], recipe[consul::ui]]
==> bootstrap: [2014-08-20T19:11:54+00:00] INFO: Run List expands to [consul::default, consul::ui]
==> bootstrap: [2014-08-20T19:11:54+00:00] INFO: Starting Chef Run for localhost
==> bootstrap: [2014-08-20T19:11:54+00:00] INFO: Running start handlers
==> bootstrap: [2014-08-20T19:11:54+00:00] INFO: Start handlers complete.
==> bootstrap: [2014-08-20T19:12:09+00:00] INFO: remote_file[/var/chef/cache/consul.zip] backed up to /var/chef/backup/var/chef/cache/consul.zip.chef-20140820191209.776259
==> bootstrap: [2014-08-20T19:12:09+00:00] INFO: remote_file[/var/chef/cache/consul.zip] updated file contents /var/chef/cache/consul.zip
==> bootstrap: [2014-08-20T19:12:10+00:00] INFO: remote_file[/var/chef/cache/consul.zip] sending run action to execute[unpack /var/chef/cache/consul.zip] (delayed)
==> bootstrap: [2014-08-20T19:12:10+00:00] INFO: execute[unpack /var/chef/cache/consul.zip] ran successfully
==> bootstrap: [2014-08-20T19:12:10+00:00] INFO: execute[unpack /var/chef/cache/consul.zip] sending run action to execute[set owner on /usr/local/bin] (delayed)
==> bootstrap: [2014-08-20T19:12:10+00:00] INFO: execute[set owner on /usr/local/bin] ran successfully
==> bootstrap: [2014-08-20T19:12:10+00:00] INFO: file[/usr/local/bin/consul] updated atime and mtime to 2014-08-20 19:12:10 +0000
==> bootstrap: [2014-08-20T19:12:10+00:00] INFO: directory[/etc/consul.d] created directory /etc/consul.d
==> bootstrap: [2014-08-20T19:12:10+00:00] INFO: directory[/etc/consul.d] owner changed to 0
==> bootstrap: [2014-08-20T19:12:10+00:00] INFO: directory[/etc/consul.d] group changed to 0
==> bootstrap: [2014-08-20T19:12:10+00:00] INFO: directory[/etc/consul.d] mode changed to 755
==> bootstrap: [2014-08-20T19:12:10+00:00] INFO: directory[/var/lib/consul] created directory /var/lib/consul
==> bootstrap: [2014-08-20T19:12:10+00:00] INFO: directory[/var/lib/consul] owner changed to 0
==> bootstrap: [2014-08-20T19:12:10+00:00] INFO: directory[/var/lib/consul] group changed to 0
==> bootstrap: [2014-08-20T19:12:10+00:00] INFO: directory[/var/lib/consul] mode changed to 755
==> bootstrap: [2014-08-20T19:12:10+00:00] INFO: file[/etc/consul.d/default.json] created file /etc/consul.d/default.json
==> bootstrap: [2014-08-20T19:12:10+00:00] INFO: file[/etc/consul.d/default.json] updated file contents /etc/consul.d/default.json
==> bootstrap: [2014-08-20T19:12:10+00:00] INFO: file[/etc/consul.d/default.json] owner changed to 0
==> bootstrap: [2014-08-20T19:12:10+00:00] INFO: file[/etc/consul.d/default.json] group changed to 0
==> bootstrap: [2014-08-20T19:12:10+00:00] INFO: file[/etc/consul.d/default.json] mode changed to 600
==> bootstrap: [2014-08-20T19:12:10+00:00] INFO: file[/etc/consul.d/default.json] sending reload action to service[consul] (immediate)
==> bootstrap:
==> bootstrap: ================================================================================
==> bootstrap: Error executing action `reload` on resource 'service[consul]'
==> bootstrap: ================================================================================
==> bootstrap:
==> bootstrap:
==> bootstrap: Chef::Exceptions::Service
==> bootstrap: -------------------------
==> bootstrap: service[consul]: unable to locate the init.d script!
==> bootstrap:
==> bootstrap:
==> bootstrap: Resource Declaration:
==> bootstrap: ---------------------
==> bootstrap: # In /tmp/vagrant-chef-3/chef-solo-1/cookbooks/consul/recipes/_service.rb
==> bootstrap:
==> bootstrap:
==> bootstrap:
==> bootstrap: 112:   service 'consul' do
==> bootstrap:
==> bootstrap: 113:     supports status: true, restart: true, reload: true
==> bootstrap:
==> bootstrap: 114:     action [:enable, :start]
==> bootstrap:
==> bootstrap: 115:     subscribes :reload, "file[#{node[:consul][:config_dir]}/default.json]", :immediately
==> bootstrap: 116:     subscribes :restart, "template[/etc/init.d/consul]", :immediately
==> bootstrap: 117:   end
==> bootstrap: 118: when 'runit'
==> bootstrap:
==> bootstrap: Compiled Resource:
==> bootstrap: ------------------
==> bootstrap: # Declared in /tmp/vagrant-chef-3/chef-solo-1/cookbooks/consul/recipes/_service.rb:112:in `from_file'
==> bootstrap:
==> bootstrap: service("consul") do
==> bootstrap:   action [:enable, :start]
==> bootstrap:   supports {:status=>true, :restart=>true, :reload=>true}
==> bootstrap:   retries 0
==> bootstrap:   retry_delay 2
==> bootstrap:   guard_interpreter :default
==> bootstrap:   service_name "consul"
==> bootstrap:   pattern "consul"
==> bootstrap:   cookbook_name :consul
==> bootstrap:   recipe_name "_service"
==> bootstrap: end
==> bootstrap:
==> bootstrap: [2014-08-20T19:12:10+00:00] INFO: Running queued delayed notifications before re-raising exception
==> bootstrap: [2014-08-20T19:12:10+00:00] ERROR: Running exception handlers
==> bootstrap: [2014-08-20T19:12:10+00:00] ERROR: Exception handlers complete
==> bootstrap: [2014-08-20T19:12:10+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> bootstrap: [2014-08-20T19:12:10+00:00] ERROR: service[consul] (consul::_service line 112) had an error: Chef::Exceptions::Service: service[consul]: unable to locate the init.d script!
==> bootstrap: [2014-08-20T19:12:10+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.

And the subsequent run was successful because default.json was not modified.

==> bootstrap: Chef 11.14.6 Omnibus package is already installed.
==> bootstrap: Running provisioner: chef_solo...
Generating chef JSON and uploading...
==> bootstrap: Running chef-solo...
==> bootstrap: [2014-08-20T19:20:16+00:00] INFO: Forking chef instance to converge...
==> bootstrap: [2014-08-20T19:20:16+00:00] WARN:
==> bootstrap: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
==> bootstrap: SSL validation of HTTPS requests is disabled. HTTPS connections are still
==> bootstrap: encrypted, but chef is not able to detect forged replies or man in the middle
==> bootstrap: attacks.
==> bootstrap:
==> bootstrap: To fix this issue add an entry like this to your configuration file:
==> bootstrap:
==> bootstrap: ```
==> bootstrap:   # Verify all HTTPS connections (recommended)
==> bootstrap:   ssl_verify_mode :verify_peer
==> bootstrap:
==> bootstrap:   # OR, Verify only connections to chef-server
==> bootstrap:   verify_api_cert true
==> bootstrap: ```
==> bootstrap:
==> bootstrap: To check your SSL configuration, or troubleshoot errors, you can use the
==> bootstrap: `knife ssl check` command like so:
==> bootstrap:
==> bootstrap: ```
==> bootstrap:   knife ssl check -c /tmp/vagrant-chef-3/solo.rb
==> bootstrap: ```
==> bootstrap:
==> bootstrap: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
==> bootstrap: [2014-08-20T19:20:16+00:00] INFO: *** Chef 11.14.6 ***
==> bootstrap: [2014-08-20T19:20:16+00:00] INFO: Chef-client pid: 5241
==> bootstrap: [2014-08-20T19:20:23+00:00] INFO: Setting the run_list to ["recipe[consul::default]", "recipe[consul::ui]"] from CLI options
==> bootstrap: [2014-08-20T19:20:23+00:00] INFO: Run List is [recipe[consul::default], recipe[consul::ui]]
==> bootstrap: [2014-08-20T19:20:23+00:00] INFO: Run List expands to [consul::default, consul::ui]
==> bootstrap: [2014-08-20T19:20:23+00:00] INFO: Starting Chef Run for localhost
==> bootstrap: [2014-08-20T19:20:23+00:00] INFO: Running start handlers
==> bootstrap: [2014-08-20T19:20:23+00:00] INFO: Start handlers complete.
==> bootstrap: [2014-08-20T19:20:25+00:00] INFO: file[/usr/local/bin/consul] updated atime and mtime to 2014-08-20 19:20:25 +0000
==> bootstrap: [2014-08-20T19:20:25+00:00] INFO: template[/etc/init.d/consul] created file /etc/init.d/consul
==> bootstrap: [2014-08-20T19:20:25+00:00] INFO: template[/etc/init.d/consul] updated file contents /etc/init.d/consul
==> bootstrap: [2014-08-20T19:20:25+00:00] INFO: template[/etc/init.d/consul] mode changed to 755
==> bootstrap: [2014-08-20T19:20:25+00:00] INFO: template[/etc/init.d/consul] sending restart action to service[consul] (immediate)
==> bootstrap: [2014-08-20T19:20:25+00:00] INFO: service[consul] restarted
==> bootstrap: [2014-08-20T19:20:25+00:00] INFO: service[consul] enabled
==> bootstrap: [2014-08-20T19:20:25+00:00] INFO: directory[/var/lib/consul/ui/] created directory /var/lib/consul/ui/
==> bootstrap: [2014-08-20T19:20:26+00:00] INFO: remote_file[/var/chef/cache/.zip] created file /var/chef/cache/.zip
==> bootstrap: [2014-08-20T19:20:32+00:00] INFO: remote_file[/var/chef/cache/.zip] updated file contents /var/chef/cache/.zip
==> bootstrap: [2014-08-20T19:20:32+00:00] INFO: remote_file[/var/chef/cache/.zip] not queuing delayed action run on execute[unpack /var/chef/cache/.zip] (delayed), as it's already been queued
==> bootstrap: [2014-08-20T19:20:32+00:00] INFO: directory[/var/lib/consul/ui/] sending run action to execute[unpack /var/chef/cache/.zip] (delayed)
==> bootstrap: [2014-08-20T19:20:32+00:00] INFO: execute[unpack /var/chef/cache/.zip] ran successfully
==> bootstrap: [2014-08-20T19:20:32+00:00] INFO: execute[unpack /var/chef/cache/.zip] sending run action to execute[set owner on /var/lib/consul/ui/] (delayed)
==> bootstrap: [2014-08-20T19:20:32+00:00] INFO: execute[set owner on /var/lib/consul/ui/] ran successfully
==> bootstrap: [2014-08-20T19:20:32+00:00] INFO: Chef Run complete in 9.266289617 seconds
==> bootstrap: [2014-08-20T19:20:32+00:00] INFO: Running report handlers
==> bootstrap: [2014-08-20T19:20:32+00:00] INFO: Report handlers complete

@johnbellone
Copy link
Contributor

This fix the issue you were seeing?

@brandocorp
Copy link
Contributor

The default-centos-65 kitchen run worked for me. Thanks!

@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants