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

28,827

Solution 1

The docs says you should copy the other way...

If the Windows service is used, the cookie should be copied from C:\Windows\system32\config\systemprofile\.erlang.cookie to the expected location for users running commands like rabbitmqctl.bat.

See http://www.rabbitmq.com/cli.html

Solution 2

In case, like me, you need this stuff really spelling out:

  1. In FileExplorer navigate to your user directory. (Paste %userprofile% in the address bar.)
  2. If you already have the file .erlang.cookie in there, delete it. If not, just go to next step.
  3. In a second FileExplorer, navigate to C:\Windows\System32\config\systemprofile.
  4. Find the file .erlang.cookie and copy it to your user directory.

Now your rabbitmqctl should be able to authenticate.

Solution 3

Answer by Robino helped me nail the issue.

I had two different .erlang.cookie file - one in admin users/admin and another in users/myprofile

I copied the one in C:\Windows\System32\config\systemprofile to both the locations users/myprofile and users/admin.

Also I copied the same cookie file to my Rabbit installation %Rabbit_Home%\sbin where I am running my rabbitmqctl.bat.

Solution 4

After having this exact issue myself, the problem was solved by running the service under my account. Try this if you are still facing the issue and have reinstalled.

Solution 5

Check the version of erlang you installed. rabbitmq v3.7.0 match with v20.1.x of erlang. supported version of Erlang

Share:
28,827
Jit
Author by

Jit

Updated on July 09, 2022

Comments

  • Jit
    Jit almost 2 years

    I installed erlang and rabbitmq in the way mentioned in the official documentation. But then, when I do this

    C:\Program Files\RabbitMQ Server\rabbitmq_server-3.7.0\sbin>rabbitmqctl add_user XXXXXX YYYYYYY

    it gives me the following error...


    Error: unable to perform an operation on node 'rabbit@C001741998'. Please see diagnostics information and suggestions below.

    Most common reasons for this are:

    • Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)
    • CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)
    • Target node is not running

    In addition to the diagnostics info below:

    DIAGNOSTICS

    attempted to contact: [rabbit@C001741998]

    rabbit@C001741998:

    • connected to epmd (port 4369) on C001741998

    • epmd reports node 'rabbit' uses port 25672 for inter-node and CLI tool traffic

    • TCP connection succeeded but Erlang distribution failed

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

    Current node details:

    • node name: rabbitmqcli49@C001741998

    • effective user's home directory: C:\Users\XYZ

    • Erlang cookie hash: QJlwBuAgrn8gN00mjqQYOw==


    I copied the erlang cookie from my user home folder to C:\Windows folder. So, they both have the same cookie. Still it keeps throwing me the error. Not sure how it should be fixed. Any help??

    UPDATE

    I figured out that the best way to run rabbitmq is from docker container. In that way, you do not need to bother about any cookie or dependencies, also you get rabbitmq up and running in few minutes. Hope it helps someone!