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

rabbitmq_plugin[rabbitmq_management] erlexec: HOME must be set #334

Closed
runningman84 opened this issue Jan 5, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@runningman84
Copy link

commented Jan 5, 2016

I tried to setup rabbitmq using the sensu-chef cookbook on this machine:
ubuntu-trusty-14.04-amd64-server-20151218 (ami-581cbe2b)

In order to use the ubuntu version I have configured this in my wrapper cookbook:

# Rabbitmq settings
normal['rabbitmq']['use_distro_version'] = true
[2016-01-05T12:42:25+00:00] INFO: Processing group[rabbitmq] action create (sensu::rabbitmq line 22)
[2016-01-05T12:42:26+00:00] INFO: group[rabbitmq] created
[2016-01-05T12:42:26+00:00] INFO: Processing directory[/etc/rabbitmq/ssl] action create (sensu::rabbitmq line 32)
[2016-01-05T12:42:26+00:00] INFO: directory[/etc/rabbitmq/ssl] created directory /etc/rabbitmq/ssl
[2016-01-05T12:42:26+00:00] INFO: Processing file[/etc/rabbitmq/ssl/cacert.pem] action create (sensu::rabbitmq line 45)
[2016-01-05T12:42:26+00:00] INFO: file[/etc/rabbitmq/ssl/cacert.pem] created file /etc/rabbitmq/ssl/cacert.pem
[2016-01-05T12:42:26+00:00] INFO: file[/etc/rabbitmq/ssl/cacert.pem] updated file contents /etc/rabbitmq/ssl/cacert.pem
[2016-01-05T12:42:26+00:00] INFO: file[/etc/rabbitmq/ssl/cacert.pem] group changed to 1001
[2016-01-05T12:42:26+00:00] INFO: file[/etc/rabbitmq/ssl/cacert.pem] mode changed to 640
[2016-01-05T12:42:26+00:00] INFO: Processing file[/etc/rabbitmq/ssl/cert.pem] action create (sensu::rabbitmq line 45)
[2016-01-05T12:42:26+00:00] INFO: file[/etc/rabbitmq/ssl/cert.pem] created file /etc/rabbitmq/ssl/cert.pem
[2016-01-05T12:42:26+00:00] INFO: file[/etc/rabbitmq/ssl/cert.pem] updated file contents /etc/rabbitmq/ssl/cert.pem
[2016-01-05T12:42:26+00:00] INFO: file[/etc/rabbitmq/ssl/cert.pem] group changed to 1001
[2016-01-05T12:42:26+00:00] INFO: file[/etc/rabbitmq/ssl/cert.pem] mode changed to 640
[2016-01-05T12:42:26+00:00] INFO: Processing file[/etc/rabbitmq/ssl/key.pem] action create (sensu::rabbitmq line 45)
[2016-01-05T12:42:26+00:00] INFO: file[/etc/rabbitmq/ssl/key.pem] created file /etc/rabbitmq/ssl/key.pem
[2016-01-05T12:42:26+00:00] INFO: file[/etc/rabbitmq/ssl/key.pem] updated file contents /etc/rabbitmq/ssl/key.pem
[2016-01-05T12:42:26+00:00] INFO: file[/etc/rabbitmq/ssl/key.pem] group changed to 1001
[2016-01-05T12:42:26+00:00] INFO: file[/etc/rabbitmq/ssl/key.pem] mode changed to 640
[2016-01-05T12:42:26+00:00] INFO: Processing directory[/etc/rabbitmq/ssl/client] action create (sensu::rabbitmq line 54)
[2016-01-05T12:42:26+00:00] INFO: directory[/etc/rabbitmq/ssl/client] created directory /etc/rabbitmq/ssl/client
[2016-01-05T12:42:26+00:00] INFO: Processing file[/etc/rabbitmq/ssl/client/cert.pem] action create (sensu::rabbitmq line 61)
[2016-01-05T12:42:26+00:00] INFO: file[/etc/rabbitmq/ssl/client/cert.pem] created file /etc/rabbitmq/ssl/client/cert.pem
[2016-01-05T12:42:26+00:00] INFO: file[/etc/rabbitmq/ssl/client/cert.pem] updated file contents /etc/rabbitmq/ssl/client/cert.pem
[2016-01-05T12:42:26+00:00] INFO: file[/etc/rabbitmq/ssl/client/cert.pem] group changed to 1001
[2016-01-05T12:42:26+00:00] INFO: file[/etc/rabbitmq/ssl/client/cert.pem] mode changed to 640
[2016-01-05T12:42:26+00:00] INFO: Processing file[/etc/rabbitmq/ssl/client/key.pem] action create (sensu::rabbitmq line 61)
[2016-01-05T12:42:26+00:00] INFO: file[/etc/rabbitmq/ssl/client/key.pem] created file /etc/rabbitmq/ssl/client/key.pem
[2016-01-05T12:42:26+00:00] INFO: file[/etc/rabbitmq/ssl/client/key.pem] updated file contents /etc/rabbitmq/ssl/client/key.pem
[2016-01-05T12:42:26+00:00] INFO: file[/etc/rabbitmq/ssl/client/key.pem] group changed to 1001
[2016-01-05T12:42:26+00:00] INFO: file[/etc/rabbitmq/ssl/client/key.pem] mode changed to 640
[2016-01-05T12:42:26+00:00] INFO: Processing apt_package[erlang-nox] action install (erlang::package line 27)
[2016-01-05T12:42:36+00:00] INFO: apt_package[erlang-nox] installed erlang-nox at 1:16.b.3-dfsg-1ubuntu2.1
[2016-01-05T12:42:36+00:00] INFO: Processing apt_package[erlang-dev] action install (erlang::package line 28)
[2016-01-05T12:42:38+00:00] INFO: apt_package[erlang-dev] installed erlang-dev at 1:16.b.3-dfsg-1ubuntu2.1
[2016-01-05T12:42:38+00:00] INFO: Processing apt_package[logrotate] action install (rabbitmq::default line 33)
[2016-01-05T12:42:38+00:00] INFO: Processing apt_package[rabbitmq-server] action install (rabbitmq::default line 36)
[2016-01-05T12:42:44+00:00] INFO: apt_package[rabbitmq-server] installed rabbitmq-server at 3.2.4-1
[2016-01-05T12:42:44+00:00] INFO: Processing service[rabbitmq-server] action enable (rabbitmq::default line 84)
[2016-01-05T12:42:44+00:00] INFO: Processing service[rabbitmq-server] action start (rabbitmq::default line 84)
[2016-01-05T12:42:44+00:00] INFO: Processing directory[/var/lib/rabbitmq/mnesia] action create (rabbitmq::default line 149)
[2016-01-05T12:42:44+00:00] INFO: directory[/var/lib/rabbitmq/mnesia] mode changed to 775
[2016-01-05T12:42:44+00:00] INFO: Processing template[/etc/rabbitmq/rabbitmq-env.conf] action create (rabbitmq::default line 156)
[2016-01-05T12:42:44+00:00] INFO: template[/etc/rabbitmq/rabbitmq-env.conf] created file /etc/rabbitmq/rabbitmq-env.conf
[2016-01-05T12:42:44+00:00] INFO: template[/etc/rabbitmq/rabbitmq-env.conf] updated file contents /etc/rabbitmq/rabbitmq-env.conf
[2016-01-05T12:42:44+00:00] INFO: template[/etc/rabbitmq/rabbitmq-env.conf] owner changed to 0
[2016-01-05T12:42:44+00:00] INFO: template[/etc/rabbitmq/rabbitmq-env.conf] group changed to 0
[2016-01-05T12:42:44+00:00] INFO: template[/etc/rabbitmq/rabbitmq-env.conf] mode changed to 644
[2016-01-05T12:42:44+00:00] INFO: template[/etc/rabbitmq/rabbitmq-env.conf] sending restart action to service[rabbitmq-server] (immediate)
[2016-01-05T12:42:44+00:00] INFO: Processing service[rabbitmq-server] action restart (rabbitmq::default line 205)
[2016-01-05T12:42:50+00:00] INFO: service[rabbitmq-server] restarted
[2016-01-05T12:42:50+00:00] INFO: Processing template[/etc/rabbitmq/rabbitmq.config] action create (rabbitmq::default line 164)
[2016-01-05T12:42:50+00:00] INFO: template[/etc/rabbitmq/rabbitmq.config] created file /etc/rabbitmq/rabbitmq.config
[2016-01-05T12:42:50+00:00] INFO: template[/etc/rabbitmq/rabbitmq.config] updated file contents /etc/rabbitmq/rabbitmq.config
[2016-01-05T12:42:50+00:00] INFO: template[/etc/rabbitmq/rabbitmq.config] owner changed to 0
[2016-01-05T12:42:50+00:00] INFO: template[/etc/rabbitmq/rabbitmq.config] group changed to 0
[2016-01-05T12:42:50+00:00] INFO: template[/etc/rabbitmq/rabbitmq.config] mode changed to 644
[2016-01-05T12:42:50+00:00] INFO: template[/etc/rabbitmq/rabbitmq.config] sending restart action to service[rabbitmq-server] (immediate)
[2016-01-05T12:42:50+00:00] INFO: Processing service[rabbitmq-server] action restart (rabbitmq::default line 205)
[2016-01-05T12:42:56+00:00] INFO: service[rabbitmq-server] restarted
[2016-01-05T12:42:56+00:00] INFO: template[/etc/rabbitmq/rabbitmq.config] sending restart action to service[restart rabbitmq-server] (immediate)
[2016-01-05T12:42:56+00:00] INFO: Processing service[restart rabbitmq-server] action restart (sensu::rabbitmq line 79)
[2016-01-05T12:43:02+00:00] INFO: service[restart rabbitmq-server] restarted
[2016-01-05T12:43:02+00:00] INFO: Processing service[rabbitmq-server] action enable (rabbitmq::default line 205)
[2016-01-05T12:43:03+00:00] INFO: Processing service[rabbitmq-server] action start (rabbitmq::default line 205)
[2016-01-05T12:43:03+00:00] INFO: Processing rabbitmq_plugin[rabbitmq_management] action enable (rabbitmq::mgmt_console line 27)
[2016-01-05T12:43:04+00:00] INFO: Enabling RabbitMQ plugin 'rabbitmq_management'.
[2016-01-05T12:43:04+00:00] INFO: Processing execute[rabbitmq-plugins enable rabbitmq_management] action run (/var/chef/cache/cookbooks/rabbitmq/providers/plugin.rb line 35)
[2016-01-05T12:43:04+00:00] INFO: Running queued delayed notifications before re-raising exception
[2016-01-05T12:43:04+00:00] INFO: Running queued delayed notifications before re-raising exception
[2016-01-05T12:43:04+00:00] INFO: template[/etc/init.d/chef-client] sending restart action to service[chef-client] (delayed)
[2016-01-05T12:43:04+00:00] INFO: Processing service[chef-client] action restart (chef-client::init_service line 32)
[2016-01-05T12:43:04+00:00] FATAL: SIGTERM received, stopping
[2016-01-05T12:43:05+00:00] INFO: Daemonizing..
[2016-01-05T12:43:05+00:00] INFO: Forked, in 14564. Privileges: 0 0
[2016-01-05T12:43:06+00:00] INFO: service[chef-client] restarted
[2016-01-05T12:43:06+00:00] INFO: cookbook_file[/etc/ntp.leapseconds] sending restart action to service[ntp] (delayed)
[2016-01-05T12:43:06+00:00] INFO: Processing service[ntp] action restart (ntp::default line 112)
[2016-01-05T12:43:08+00:00] INFO: service[ntp] restarted
[2016-01-05T12:43:08+00:00] INFO: cookbook_file[/etc/apparmor.d/usr.sbin.ntpd] sending restart action to service[apparmor] (delayed)
[2016-01-05T12:43:08+00:00] INFO: Processing service[apparmor] action restart (ntp::apparmor line 20)
[2016-01-05T12:43:10+00:00] INFO: service[apparmor] restarted
[2016-01-05T12:43:10+00:00] ERROR: Running exception handlers
[2016-01-05T12:43:10+00:00] ERROR: Exception handlers complete
[2016-01-05T12:43:10+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2016-01-05T12:43:10+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-01-05T12:43:10+00:00] ERROR: rabbitmq_plugin[rabbitmq_management] (rabbitmq::mgmt_console line 27) had an error: Mixlib::ShellOut::ShellCommandFailed: execute[rabbitmq-plugins enable rabbitmq_management] (/var/chef/cache/cookbooks/rabbitmq/providers/plugin.rb line 35) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of rabbitmq-plugins enable rabbitmq_management ----
STDOUT: 
STDERR: erlexec: HOME must be set
---- End output of rabbitmq-plugins enable rabbitmq_management ----
Ran rabbitmq-plugins enable rabbitmq_management returned 1
[2016-01-05T12:43:10+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Broadcast message from root@ip-172-31-21-124
    (unknown) at 12:43 ...
@runningman84

This comment has been minimized.

Copy link
Author

commented Jan 5, 2016

Funny enough this issue only occurs if chef-client is started from cfn/cloud init. If start chef-client manually in a ssh session everything works fine...

Adding the HOME env fixed the issue here:

              "99_chef_first_run": {
                "command": "chef-client -j /etc/chef/first_run.json",
                "cwd": "~",
                "env": {
                  "HOME": "/root"
                },
                "test": "test -e /etc/chef/validator.pem"
              }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.