Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RabbitMQ node authentification failed after changing cookie file

I have multiple RabbitMQ nodes running on different machines. After installing each node I failed to specify a common cookie for each of them to use so I had to go back and manually change the file .erlang.cookie . My issue is that after doing this I get conflicting error messages. If i do rabbitmqctl status I get the following error:

DIAGNOSTICS

attempted to contact: ['rabbit@nc-mso-test01']

rabbit@nc-mso-test01: * connected to epmd (port 4369) on nc-mso-test01 * epmd reports node 'rabbit' running on port 25672 * TCP connection succeeded but Erlang distribution failed

  • Authentication failed (rejected by the remote node), please check the Erlang cookie

current node details: - node name: 'rabbitmq-cli-45@nc-mso-test01' - home dir: C:\Users\jol - cookie hash: 9/Hx6l+wLQv3NkmSDFqBog==

Whatever script I call, I get the same error. I tried restarting the service, removing and installing it through rabbitmq-service. The error persists. From what I can gather from other posts, the reason might be that the node and the erlang broker are running on separate users and each of them have a different version of the cookie, one is stuck with the old one.

How can I make the server and node restart, so that both of them use the new cookie file?

like image 587
Iustinian Olaru Avatar asked Nov 10 '16 13:11

Iustinian Olaru


People also ask

Why does RabbitMQ fail to authenticate when using CLI tools?

If RabbitMQ is installed using a non-administrative account, a shared secret file used by nodes and CLI tools will not be placed into a correct location, leading to authentication failures when rabbitmqctl.bat and other CLI tools are used.

How to fix “failed to create cookie file (drive:)/Erlang)” in RabbitMQ?

RabbitMQ – “Failed to create cookie file (drive:)/erlang” 1 Open command prompt as administrator 2 Change directory to the Program FilesRabbitMQ Serverrabbitmq_server-3.5.5sbin directory 3 Run the following commands: More ...

Why is my RabbitMQ Cookie not being read?

The cookie is read by the runtime, not RabbitMQ. Except for default location on Windows, nothing in that area has changed in many years. Make sure that the path is what you expect and that the file is readable. A number of other common reasons is listed right in the message.

How do I encrypt user credentials in RabbitMQ?

As with all values in rabbitmq.conf, the # character starts a comment so this character must be avoided in generated credentials. Default user credentials can also be encrypted. That requires the use of the advanced configuration file, advanced.config .


1 Answers

I solved my issue. I missed the fact that the RabbitMQ setup has two cookie files, one in c:\Windows for the erlang component, and one in C:\Users\%USER%. From what I understand, if the erlan VM is started on it's own application user and the RabbitMQ node is started on a different user, which would have been my case, then the two cookie files were different and I had to sync those up before syncing the cluster cookies.

like image 85
Iustinian Olaru Avatar answered Sep 17 '22 23:09

Iustinian Olaru