7

I am trying to setup OpenStack on Ubuntu 12.04 using devstack. Now, the error I am getting is:

Setting up rabbitmq-server (2.7.1-0ubuntu4) ...
Starting rabbitmq-server: FAILED - check /var/log/rabbitmq/startup_{log, _err}
rabbitmq-server.
invoke-rc.d: initscript rabbitmq-server, action "start" failed.
dpkg: error processing rabbitmq-server (--configure):
 subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 rabbitmq-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
++ err_trap
++ local r=100
++ set +o xtrace
stack.sh failed

Any idea why am I getting this error?

Pensu
  • 3,263
  • 10
  • 46
  • 71

7 Answers7

19

I had this issue twice, when either hostname or ip address in the hosts file didn't match. Therefore, check that you provide the correct ip address and hostname in the /etc/hosts file

  1. Run sudo cat /etc/hostname to see your hostname

Output:

yoursite
  1. Run sudo nano /etc/hosts

File contains:

127.0.0.1 yoursite

As you see from cat /etc/hostname, hostname is the same as in the /etc/hosts:

  1. Run sudo rabbitmq-server start to start the rabbitmq-server
Kostyantyn
  • 5,041
  • 3
  • 34
  • 30
4

Try deleting the folder /var/lib/rabbitmq and re-running ./stack.sh

If that doesn't work either, run the following after stach.sh fails:

chown -R rabbitmq:rabbitmq /var/lib/rabbitmq chown -R rabbitmq:rabbitmq /var/log/rabbitmq

service rabbitmq-server restart

and check the status of rabbitmq using "rabbitmqctl status"

woooh77
  • 141
  • 1
  • 4
3

Similar thing happen to me. Rabbit depends on being able to resolve a hostname, run this:

echo "127.0.0.1 $(hostname -s)" | sudo tee -a /etc/hosts

Janusz Skonieczny
  • 17,642
  • 11
  • 55
  • 63
2

This way works for me. First go to

sudo vim /etc/hosts

and set

127.0.0.1 <hostname>

then open firewall

sudo rabbitmq-plugins enable rabbitmq_management
sudo service rabbitmq-server restart
Prakash S
  • 21
  • 4
0

For a clean environment, this will not happen. You must run devstack for several times, and one of them failed but you didn't get it cleaned.

run command pf -ef | grep rabbitmq, kill all rabbitmq processes. then it would be fine to run ./stack.sh

it is highly recommended to run ./unstack.sh && ./clean.sh before ./stack.sh

ZhiQiang Fan
  • 986
  • 6
  • 7
0

Just to be sure, take a look to your local network

ip add

If there's no lo network, then you should enable it:

ifconfig lo up

Then restart the server again and let's see if it works again now

systemctl start rabbitmq-server
Steve Piercy
  • 13,693
  • 1
  • 44
  • 57
0

I had the same problem though my /etc/hosts and DNS were OK. I suspect that SystemV init script was started too early when the network was not ready yet. I rewrote the startup script to systemd on CentOS 7.8 and it seems to work well now.

[Unit]
Description=RabbitMQ
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
RuntimeDirectory=rabbitmq
PrivateTmp=true
Restart=on-failure
RestartSec=10

WorkingDirectory=/opt/data/rabbitmq/
User=rabbitmq
Group=rabbitmq

ExecStart=/opt/app/rabbitmq/default/sbin/rabbitmq-server
ExecStop=/opt/app/rabbitmq/default/sbin/rabbitmqctl stop
ExecStop=/bin/sh -c "while ps -p $MAINPID >/dev/null 2>&1; do sleep 1; done"

StandardOutput=journal
StandardError=inherit

[Install]
WantedBy=multi-user.target
Leos Literak
  • 8,805
  • 19
  • 81
  • 156