Chef Installation Error – Error executing action `run` on resource

chefubuntu-12.04

I am trying install chef (chef-server_11.0.4-1.ubuntu.12.04) on ubuntu 12.04.5 64 bit.

After the installation, when I run "chef-server-ctl reconfigure" getting following error.

let me know how to install it.

[2014-12-20T14:16:10+05:30] ERROR: Running exception handlers
[2014-12-20T14:16:10+05:30] ERROR: Exception handlers complete
Chef Client failed. 2 resources updated
[2014-12-20T14:16:10+05:30] FATAL: Stacktrace dumped to /opt/chef-server/embedded/cookbooks/cache/chef-stacktrace.out
[2014-12-20T14:16:10+05:30] FATAL: Mixlib::ShellOut::ShellCommandFailed: execute[/opt/chef-server/embedded/bin/chpst -u chef_server -U chef_server /opt/chef-server/embedded/bin/rabbitmqctl wait /var/opt/chef-server/rabbitmq/db/rabbit@localhost.pid] (chef-server::rabbitmq line 80) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '2'
---- Begin output of /opt/chef-server/embedded/bin/chpst -u chef_server -U chef_server /opt/chef-server/embedded/bin/rabbitmqctl wait /var/opt/chef-server/rabbitmq/db/rabbit@localhost.pid ----
STDOUT: Waiting for rabbit@localhost ...
pid is 6031 ...
STDERR: Error: process_not_running
---- End output of /opt/chef-server/embedded/bin/chpst -u chef_server -U chef_server /opt/chef-server/embedded/bin/rabbitmqctl wait /var/opt/chef-server/rabbitmq/db/rabbit@localhost.pid ----
Ran /opt/chef-server/embedded/bin/chpst -u chef_server -U chef_server /opt/chef-server/embedded/bin/rabbitmqctl wait /var/opt/chef-server/rabbitmq/db/rabbit@localhost.pid returned 2

Updated error after restarting Rabbitmq Server

> [2014-12-23T09:55:15+05:30] ERROR: Running exception handlers
> [2014-12-23T09:55:15+05:30] ERROR: Exception handlers complete Chef
> Client failed. 8 resources updated [2014-12-23T09:55:15+05:30] FATAL:
> Stacktrace dumped to
> /opt/chef-server/embedded/cookbooks/cache/chef-stacktrace.out
> [2014-12-23T09:55:15+05:30] FATAL:
> Mixlib::ShellOut::ShellCommandFailed: execute[verify-system-status]
> (chef-server::bootstrap line 21) had an error:
> Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with
> [0], but received '7'
> ---- Begin output of curl -sf http://localhost:8000/_status ---- STDOUT: STDERR:
> ---- End output of curl -sf http://localhost:8000/_status ---- Ran curl -sf http://localhost:8000/_status returned 7

Best Answer

There's a known issue with the chef installation on Ubuntu. During the reconfigure it attempts to launch and connect to rabbitmq however the rabbitmq server is already running so the start fails.

The other thing that can potentially happen is not having a localhost entry in your /etc/hosts file.

The most likely thing is the already running rabbitmq, in which case give this a try:

/etc/init.d/rabbitmq-server stop && chef-server-ctl reconfigure

If that doesn't work check to make sure the following exists in /etc/hosts:

127.0.0.1 localhost
Related Topic