Created
October 2, 2017 14:53
-
-
Save ziyan-junaideen/316b76560b33250661ee42d61f7d52f4 to your computer and use it in GitHub Desktop.
When I run `sudo chef-client` I get an error... It says to open an issue with chef-stacktrace.out, given I am learning chef chances are the issue is me. Appreciate any help :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Cookbook:: myhaproxy | |
# Recipe:: default | |
# | |
# Copyright:: 2017, The Authors, All Rights Reserved. | |
# node.default['haproxy']['members'] = [{ | |
# 'hostname' => 'web1', | |
# 'ipaddress' => '192.168.10.43', | |
# 'port' => 80, | |
# 'ssl_port' => 80 | |
# }] | |
# | |
# include_recipe 'haproxy::manual' | |
# include_recipe 'haproxy' | |
haproxy_install 'package' do | |
end | |
haproxy_config_global '' do | |
chroot '/var/lib/haproxy' | |
daemon true | |
maxconn 256 | |
log '/dev/log local0' #It can also be defined as Array | |
log_tag 'WARDEN' | |
pidfile '/var/run/haproxy.pid' | |
stats socket: '/var/lib/haproxy/stats level admin' | |
tuning 'bufsize' => '262144' | |
end | |
haproxy_config_defaults '' do | |
mode 'http' | |
timeout connect: '5000ms', | |
client: '5000ms', | |
server: '5000ms' | |
end | |
haproxy_frontend 'http-in' do | |
bind '*:80' | |
extra_options( | |
'redirect' => [ | |
'code 301 prefix / if acl1', | |
'scheme https if !acl_2' | |
]) | |
default_backend 'servers' | |
end | |
haproxy_backend 'servers' do | |
server ['web1 192.168.10.43:80 maxcon 32'] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Generated at 2017-10-02 13:46:02 +0000 | |
Mixlib::ShellOut::ShellCommandFailed: poise_service[haproxy] (/var/chef/cache/cookbooks/haproxy/resources/install.rb line 129) had an error: Mixlib::ShellOut::ShellCommandFailed: service[haproxy] (/var/chef/cache/cookbooks/haproxy/resources/install.rb line 129) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1' | |
---- Begin output of /bin/systemctl --system start haproxy ---- | |
STDOUT: | |
STDERR: Job for haproxy.service failed because the control process exited with error code. See "systemctl status haproxy.service" and "journalctl -xe" for details. | |
---- End output of /bin/systemctl --system start haproxy ---- | |
Ran /bin/systemctl --system start haproxy returned 1 | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/mixlib-shellout-2.3.2/lib/mixlib/shellout.rb:293:in `invalid!' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/mixlib-shellout-2.3.2/lib/mixlib/shellout.rb:280:in `error!' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/mixin/shell_out.rb:130:in `shell_out_with_systems_locale!' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/provider/service/systemd.rb:104:in `start_service' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/provider/service.rb:135:in `block in action_start' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/mixin/why_run.rb:52:in `add_action' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/provider.rb:202:in `converge_by' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/provider/service.rb:134:in `action_start' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/provider.rb:171:in `run_action' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/resource.rb:591:in `run_action' | |
/var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_providers/base.rb:75:in `block in action_start' | |
/var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_providers/base.rb:136:in `notify_if_service' | |
/var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_providers/base.rb:74:in `action_start' | |
/var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_providers/base.rb:61:in `action_enable' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/provider.rb:171:in `run_action' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/resource.rb:591:in `run_action' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/runner.rb:70:in `run_action' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/runner.rb:78:in `block in run_action' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/runner.rb:76:in `each' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/runner.rb:76:in `run_action' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/runner.rb:128:in `run_delayed_notification' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/runner.rb:116:in `block in run_delayed_notifications' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/runner.rb:115:in `each' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/runner.rb:115:in `run_delayed_notifications' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/runner.rb:105:in `converge' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/client.rb:715:in `block in converge' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/client.rb:710:in `catch' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/client.rb:710:in `converge' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/client.rb:749:in `converge_and_save' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/client.rb:286:in `run' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/application.rb:291:in `block in fork_chef_client' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/application.rb:279:in `fork' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/application.rb:279:in `fork_chef_client' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/application.rb:244:in `block in run_chef_client' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/local_mode.rb:44:in `with_server_connectivity' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/application.rb:232:in `run_chef_client' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/application/client.rb:469:in `sleep_then_run_chef_client' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/application/client.rb:458:in `block in interval_run_chef_client' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/application/client.rb:457:in `loop' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/application/client.rb:457:in `interval_run_chef_client' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/application/client.rb:441:in `run_application' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/application.rb:59:in `run' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/bin/chef-client:26:in `<top (required)>' | |
/bin/chef-client:58:in `load' | |
/bin/chef-client:58:in `<main>' | |
>>>> Caused by Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1' | |
---- Begin output of /bin/systemctl --system start haproxy ---- | |
STDOUT: | |
STDERR: Job for haproxy.service failed because the control process exited with error code. See "systemctl status haproxy.service" and "journalctl -xe" for details. | |
---- End output of /bin/systemctl --system start haproxy ---- | |
Ran /bin/systemctl --system start haproxy returned 1 | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/mixlib-shellout-2.3.2/lib/mixlib/shellout.rb:293:in `invalid!' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/mixlib-shellout-2.3.2/lib/mixlib/shellout.rb:280:in `error!' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/mixin/shell_out.rb:130:in `shell_out_with_systems_locale!' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/provider/service/systemd.rb:104:in `start_service' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/provider/service.rb:135:in `block in action_start' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/mixin/why_run.rb:52:in `add_action' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/provider.rb:202:in `converge_by' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/provider/service.rb:134:in `action_start' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/provider.rb:171:in `run_action' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/resource.rb:591:in `run_action' | |
/var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_providers/base.rb:75:in `block in action_start' | |
/var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_providers/base.rb:136:in `notify_if_service' | |
/var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_providers/base.rb:74:in `action_start' | |
/var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_providers/base.rb:61:in `action_enable' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/provider.rb:171:in `run_action' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/resource.rb:591:in `run_action' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/runner.rb:70:in `run_action' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/runner.rb:78:in `block in run_action' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/runner.rb:76:in `each' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/runner.rb:76:in `run_action' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/runner.rb:128:in `run_delayed_notification' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/runner.rb:116:in `block in run_delayed_notifications' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/runner.rb:115:in `each' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/runner.rb:115:in `run_delayed_notifications' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/runner.rb:105:in `converge' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/client.rb:715:in `block in converge' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/client.rb:710:in `catch' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/client.rb:710:in `converge' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/client.rb:749:in `converge_and_save' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/client.rb:286:in `run' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/application.rb:291:in `block in fork_chef_client' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/application.rb:279:in `fork' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/application.rb:279:in `fork_chef_client' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/application.rb:244:in `block in run_chef_client' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/local_mode.rb:44:in `with_server_connectivity' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/application.rb:232:in `run_chef_client' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/application/client.rb:469:in `sleep_then_run_chef_client' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/application/client.rb:458:in `block in interval_run_chef_client' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/application/client.rb:457:in `loop' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/application/client.rb:457:in `interval_run_chef_client' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/application/client.rb:441:in `run_application' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/lib/chef/application.rb:59:in `run' | |
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.24/bin/chef-client:26:in `<top (required)>' | |
/bin/chef-client:58:in `load' | |
/bin/chef-client:58:in `<main>' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
================================================================================ | |
Error executing action `start` on resource 'service[haproxy]' | |
================================================================================ | |
Mixlib::ShellOut::ShellCommandFailed | |
------------------------------------ | |
Expected process to exit with [0], but received '1' | |
---- Begin output of /bin/systemctl --system start haproxy ---- | |
STDOUT: | |
STDERR: Job for haproxy.service failed because the control process exited with error code. See "systemctl status haproxy.service" and "journalctl -xe" for details. | |
---- End output of /bin/systemctl --system start haproxy ---- | |
Ran /bin/systemctl --system start haproxy returned 1 | |
Cookbook Trace: | |
--------------- | |
/var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_providers/base.rb:75:in `block in action_start' | |
/var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_providers/base.rb:136:in `notify_if_service' | |
/var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_providers/base.rb:74:in `action_start' | |
/var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_providers/base.rb:61:in `action_enable' | |
Resource Declaration: | |
================================================================================ | |
Error executing action `enable` on resource 'poise_service[haproxy]' | |
================================================================================ | |
Mixlib::ShellOut::ShellCommandFailed | |
------------------------------------ | |
service[haproxy] (/var/chef/cache/cookbooks/haproxy/resources/install.rb line 129) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1' | |
---- Begin output of /bin/systemctl --system start haproxy ---- | |
STDOUT: | |
STDERR: Job for haproxy.service failed because the control process exited with error code. See "systemctl status haproxy.service" and "journalctl -xe" for details. | |
---- End output of /bin/systemctl --system start haproxy ---- | |
Ran /bin/systemctl --system start haproxy returned 1 | |
Cookbook Trace: | |
--------------- | |
/var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_providers/base.rb:75:in `block in action_start' | |
/var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_providers/base.rb:136:in `notify_if_service' | |
/var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_providers/base.rb:74:in `action_start' | |
/var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_providers/base.rb:61:in `action_enable' | |
Resource Declaration: | |
--------------------- | |
# In /var/chef/cache/cookbooks/haproxy/resources/install.rb | |
129: poise_service 'haproxy' do | |
130: provider :systemd | |
131: command "#{haproxy_systemd_wrapper} -f #{new_resource.config_file} -p /run/haproxy.pid $OPTIONS" | |
132: options reload_signal: 'USR2', | |
133: restart_mode: 'always', | |
134: after_target: 'network', | |
135: auto_reload: true, | |
136: template: 'haproxy:haproxy.service.erb' | |
137: action :nothing | |
138: end | |
139: elsif !new_resource.install_only | |
Compiled Resource: | |
------------------ | |
# Declared in /var/chef/cache/cookbooks/haproxy/resources/install.rb:129:in `block (2 levels) in class_from_file' | |
poise_service("haproxy") do | |
provider PoiseService::ServiceProviders::Systemd | |
action [:nothing] | |
updated true | |
updated_by_last_action true | |
default_guard_interpreter :default | |
declared_type :poise_service | |
cookbook_name "myhaproxy" | |
command "/usr/sbin/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid $OPTIONS" | |
options {"reload_signal"=>"USR2", "restart_mode"=>"always", "after_target"=>"network", "auto_reload"=>true, "template"=>"haproxy:haproxy.service.erb"} | |
stop_signal "TERM" | |
reload_signal "HUP" | |
service_name "haproxy" | |
user "root" | |
directory "/" | |
restart_on_update true | |
end | |
System Info: | |
------------ | |
chef_version=13.4.24 | |
platform=centos | |
platform_version=7.2.1511 | |
ruby=ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux] | |
program_name=chef-client worker: ppid=4766;start=13:45:28; | |
executable=/opt/chef/bin/chef-client | |
Running handlers: | |
[2017-10-02T13:46:00+00:00] ERROR: Running exception handlers | |
Running handlers complete | |
[2017-10-02T13:46:00+00:00] ERROR: Exception handlers complete | |
Chef Client failed. 10 resources updated in 31 seconds | |
[2017-10-02T13:46:02+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out | |
[2017-10-02T13:46:02+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report | |
[2017-10-02T13:46:02+00:00] ERROR: poise_service[haproxy] (/var/chef/cache/cookbooks/haproxy/resources/install.rb line 129) had an error: Mixlib::ShellOut::ShellCommandFailed: service[haproxy] | |
(/var/chef/cache/cookbooks/haproxy/resources/install.rb line 129) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1' | |
---- Begin output of /bin/systemctl --system start haproxy ---- | |
STDOUT: | |
STDERR: Job for haproxy.service failed because the control process exited with error code. See "systemctl status haproxy.service" and "journalctl -xe" for details. | |
---- End output of /bin/systemctl --system start haproxy ---- | |
Ran /bin/systemctl --system start haproxy returned 1 | |
[2017-10-02T13:46:02+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name 'myhaproxy' | |
maintainer 'The Authors' | |
maintainer_email '[email protected]' | |
license 'All Rights Reserved' | |
description 'Installs/Configures myhaproxy' | |
long_description 'Installs/Configures myhaproxy' | |
version '0.1.2' | |
chef_version '>= 12.1' if respond_to?(:chef_version) | |
# The `issues_url` points to the location where issues for this cookbook are | |
# tracked. A `View Issues` link will be displayed on this cookbook's page when | |
# uploaded to a Supermarket. | |
# | |
# issues_url 'https://github.com/<insert_org_here>/myhaproxy/issues' | |
# The `source_url` points to the development repository for this cookbook. A | |
# `View Source` link will be displayed on this cookbook's page when uploaded to | |
# a Supermarket. | |
# | |
# source_url 'https://github.com/<insert_org_here>/myhaproxy' | |
depends 'haproxy', '= 5.0.0' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment