Unable to connect to rabbitmq

Hi everyone

I have installed Aiida in my workstation a few times before. I decided to reinstall it because I was having some issues with my conda environment and I wanted to check if a fresh reinstallation of everything I had would solve the issue.

I must say that in previous installations I was having issues with postgresql and I had to change the ports of the connection. This problem was solved in another topic Cannot connect to database - #5 by jgarridoa

The issue I am facing now involves rabbitmq:
:heavy_check_mark: version: AiiDA v2.5.1
:heavy_check_mark: config: /home/ICN2/jgarridoa/.aiida
:heavy_check_mark: profile: Jaime
:heavy_check_mark: storage: Storage for ‘Jaime’ [open] @ postgresql://aiida_qs_jgarridoa_356b0e1fd35b8bba1ab60473c3a74553:***@localhost:15451/Jaime_jgarridoa_356b0e1fd35b8bba1ab60473c3a74553 / DiskObjectStoreRepository: 72e6696fac72486fa67846874f28dd5b | /home/ICN2/jgarridoa/.aiida/repository/Jaime/container
✘ rabbitmq: Unable to connect to rabbitmq with URL: amqp://guest:guest@
Error: ConnectionResetError: [Errno 104] Connection reset by peer
:record_button: daemon: The daemon is not running.

After searching for possible solutions, I think it has to do with the default configuration of rabbitmq, which has 5672 as the default port. I have tried to change this default port by modifying rabbitmq-env.conf /etc/rabbitmq, but it does not affect at all and rabbitmq still tries to connect to 5672.

I have also tried to find the location of the other configuration files of rabbitmq, but I simply cannot find them anywhere.

Is it possible to get some help with this?

Thanks in advance


Hi Jaime,

Can you try to start rabbitmq server without -detached option. Then you can see the error message if it is no able to start.
I guess maybe the issue comes from that you have previous running rabbitmq service that occupied 5672 port?

Eliminating the -detached option I get :

(aiida) jgarridoa@PE23011465:~$ rabbitmq-server
Configuring logger redirection
12:15:51.759 [error]

12:15:51.765 [error] BOOT FAILED
12:15:51.765 [error] ===========

12:15:51.765 [error] ERROR: distribution port 25672 in use by another node: rabbit@PE23011465
ERROR: distribution port 25672 in use by another node: rabbit@PE23011465
12:15:51.765 [error]

12:15:52.766 [error] Supervisor rabbit_prelaunch_sup had child prelaunch started with rabbit_prelaunch:run_prelaunch_first_phase() at undefined exit with reason {dist_port_already_used,25672,“rabbit”,“PE23011465”} in context start_error
12:15:52.767 [error] CRASH REPORT Process <0.153.0> with 0 neighbours exited with reason: {{shutdown,{failed_to_start_child,prelaunch,{dist_port_already_used,25672,“rabbit”,“PE23011465”}}},{rabbit_prelaunch_app,start,[normal,]}} in application_master:init/4 line 138
{“Kernel pid terminated”,application_controller,“{application_start_failure,rabbitmq_prelaunch,{{shutdown,{failed_to_start_child,prelaunch,{dist_port_already_used,25672,"rabbit","PE23011465"}}},{rabbit_prelaunch_app,start,[normal,]}}}”}
Kernel pid terminated (application_controller) ({application_start_failure,rabbitmq_prelaunch,{{shutdown,{failed_to_start_child,prelaunch,{dist_port_already_used,25672,“rabbit”,“PE23011465”}}},{rabbit

Crash dump is being written to: erl_crash.dump…done

It makes sense that the issue might come from the fact that I have previous rabbitmq services on that port. But how can I shut down them all?

Could you try the solution mentioned in Node failed to boot with ERROR: distribution port 25672 in use by another node · rabbitmq/rabbitmq-server · Discussion #2460 · GitHub?

I think the provided solution does not work:

(aiida) jgarridoa@PE23011465:~$ rabbitmqctl shutdown -n rabbit@prod
Error (argument validation):
This command can only --wait for shutdown of local nodes but node rabbit@prod seems to be remote (local hostname: PE23011465, remote: prod).
Pass --no-wait to shut node rabbit@prod down without waiting.

Arguments given:
shutdown -n rabbit@prod


rabbitmqctl [–node ] [–longnames] [–quiet] shutdown [–wait] [–timeout ]
(aiida) jgarridoa@PE23011465:~$

Do you have clue where is that service coming from? If this is you machine and you have sudo permission, you can check the PID of the process by sudo lsof -i :25672 and kill it.

I will let you know tomorrow. I do not have sudo but my supervisor does. I will give more info tomorrow.

I already killed it :

(aiida) jgarridoa@PE23011465:~$ sudo lsof -i :25672

beam.smp 83492 jgarridoa 80u IPv4 345646 0t0 TCP *:25672 (LISTEN)

(aiida) jgarridoa@PE23011465:~$ kill 83492

The process was linked to my own user.

Do you have clue where is that service coming from?

Could it be a previous installation of aiida? Maybe the process did not shut down after deleting all my conda environments or something similar. Does it make sense?

Now that I have killed the process, should I make the aiida setup now again?

Thanks in advance


I assume you can run the rabbitmq-server again to start the service (or with the -d).


I simply ran rabbitmq-server with the -detached option and now it works!

Thanks a lot for your help


1 Like