rabbitmq-server fails to start when /var/log/rabbitmq does not exist

Bug #1585043 reported by Michael Baudino
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
RabbitMQ
Fix Released
Unknown
rabbitmq-server (Ubuntu)
Won't Fix
High
Unassigned

Bug Description

rabbitmq-server fails to start (`sudo service [re]start rabbitmq-server`) if the log directory (`/var/log/rabbitmq` by default) does not exist.

It's a frequent use-case for people who mount `/var/log` as `tmpfs` (e.g. for SSD optimization).

The script just hangs forever and does not provide any useful output nor (you guessed it) any log.

Running `sudo mkdir /var/log/rabbitmq && sudo chown rabbitmq:rabbitmq /var/log && sudo service rabbitmq-server restart` starts it successfully, though.

Bug noticed on rabbitmq-server 3.6.2-1 but it may affect other versions too.

Feel free to ask more information, I reproduce this bug every single morning when starting my computer ;-)

Revision history for this message
Breno Leitão (breno-leitao) wrote :

I was able to reproduce this issue also:

Oct 17 14:01:11 u1610 rabbitmq[23206]: /usr/sbin/rabbitmq-server: 33: /usr/sbin/rabbitmq-server: cannot create /var/log/rabbitmq/startup_log: Dir
Oct 17 14:01:11 u1610 systemd[1]: rabbitmq-server.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Oct 17 14:01:12 u1610 rabbitmq[23207]: Waiting for rabbit@u1610 ...
Oct 17 14:01:12 u1610 rabbitmq[23207]: pid is 21986 ...
Oct 17 14:01:12 u1610 rabbitmq[23207]: Error: process_not_running
Oct 17 14:01:12 u1610 systemd[1]: rabbitmq-server.service: Control process exited, code=exited status=2
Oct 17 14:01:12 u1610 systemd[1]: Failed to start RabbitMQ Messaging Server.
-- Subject: Unit rabbitmq-server.service has failed

Joshua Powers (powersj)
Changed in rabbitmq-server (Ubuntu):
status: New → Triaged
importance: Undecided → High
Revision history for this message
Joshua Powers (powersj) wrote :

Confirmed it still occurs in Zesty with 3.6.6-1

Changed in rabbitmq-server (Ubuntu):
assignee: nobody → Joshua Powers (powersj)
status: Triaged → In Progress
Revision history for this message
Joshua Powers (powersj) wrote :

Because this occurs on the latest development branch of Ubuntu and because we do not have a delta with Debian I went and confirmed whether this was occurring upstream or not. I did confirm that it was occurring on the latest upstream release from 5 days ago (3.6.7) and filed an upstream issue. That issue is attached to this bug now and I will wait to see what they have to say.

Here is a direct URL:
https://github.com/rabbitmq/rabbitmq-server/issues/1151

Revision history for this message
Joshua Powers (powersj) wrote :

Well that was fast as I had a quick back and forth on that bug I linked above. Feel free to add any more details if you want.

The heart of the issue comes down to the fact that the rabbitmq-server runs as a non-root user who will not have permissions to create a directory in /var/log. The result is not being able to create the log directory and failure to start. To be fair, rabbitmq-server does try to create the directory as noted in the Github issue above.

One solution to avoid this, the rabbitmq-server packaging would need to be changed to run the service as a root user or log to somewhere it would have permissions to going forward. I do not believe we would want to change this, so I am going to mark this bug as "wont fix". If you have any further details, questions, or notes feel free to add them here or to the Github bug above.

Changed in rabbitmq-server (Ubuntu):
status: In Progress → Won't Fix
assignee: Joshua Powers (powersj) → nobody
Changed in rabbitmq:
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.