70

On a Windows 7 Enterprise machine, I made a fresh install of Erlang 17.4 and RabbitMQ 3.4.3 x64. The installation was successful and uneventful.

I have not yet tried to create my first queue or exchange, but I already see trouble. This problem is similar to another SO post, but that other post appears to involve clustering, which I don't have. Furthermore, that other poster can circumvent his issue by restarting the RabbitMQ service; that approach does not work for me.

My "nodedown" problem is evident at the RabbitMQ command prompt:

C:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.4.3\sbin>rabbitmqctl status Status of node rabbit@TPAJ05421843 ...
Error: unable to connect to node rabbit@TPAJ05421843: nodedown

DIAGNOSTICS

attempted to contact: [rabbit@TPAJ05421843]

rabbit@TPAJ05421843:
* connected to epmd (port 4369) on TPAJ05421843
* epmd reports: node 'rabbit' not running at all
other nodes on TPAJ05421843: ['RabbitMQ']
* suggestion: start the node

current node details:
- node name: 'rabbitmqctl-19884@TPAJ05421843'
- home dir: H:\
- cookie hash: PD4QQCYrf0TME9vIko3Xuw==

Based on the above, I chose to check the status of the node explicitly named 'RabbitMQ'. I get this:

C:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.4.3\sbin>rabbitmqctl -n RabbitMQ status
Status of node 'RabbitMQ@TPAJ05421843' ...
Error: unable to connect to node 'RabbitMQ@TPAJ05421843': nodedown

DIAGNOSTICS

attempted to contact: ['RabbitMQ@TPAJ05421843']

RabbitMQ@TPAJ05421843:
* connected to epmd (port 4369) on TPAJ05421843
* epmd reports node 'RabbitMQ' running on port 59301
* TCP connection succeeded but Erlang distribution failed
* suggestion: hostname mismatch?
* suggestion: is the cookie set correctly?

current node details:
- node name: 'rabbitmqctl-23076@TPAJ05421843'
- home dir: H:\
- cookie hash: PD4QQCYrf0TME9vIko3Xuw==

Ok, this is barely better since at least it acknowledges 'RabbitMQ' running on port 59301. But what the heck could it mean that "Erlang distribution failed"?

When I try to research this topic, I found articles saying "be sure you have matched cookies." Based on that I found this article, which claims the "cookie mismatch" does not pertain to me, because I have not created (nor intend to create) a RabbitMQ cluster.

What should I do?

2240
  • 1,547
  • 2
  • 12
  • 30
Brent Arias
  • 29,277
  • 40
  • 133
  • 234
  • In my case it's because I installed it as Administrator and then tried to use the sbin scripts as a regular user. – Dave Apr 27 '16 at 20:39
  • 3
    In my case, cookies didn't match `C:\Windows\.erlang.cookie` and `C:\Users\my_user_name\.erlang.cookie`. Copying one over another fixed the issue. – eddyP23 Aug 16 '16 at 10:22

12 Answers12

138

I had this same problem today. There were no cookie or firewall problems and windows reported that the service was running successfully. This is what finally fixed it:

  1. Run RabbitMQ sbin command prompt as administrator.
  2. Run "rabbitmq-service remove"
  3. Run "rabbitmq-service install"

For some reason the service set up by the installer did not configure several registry entries. Running this set them correctly and allowed the service to run.

One thing I noticed was that before I did this, there was no description of the service in the Windows Services view. After installing with the rabbitmq-service command, the description was visible. This might be a quick indicator if you are having the same problem.

Jerdev
  • 1,395
  • 1
  • 9
  • 6
  • 1
    Yeah, it seems to be an issue within the RabbitMQ installer not registering the service correctly. – Gray Fox Jan 05 '16 at 16:56
  • Confirmed this works also when the service **is** correctly visible in the Windows Services view but still doesn't work for some reason without this posted solution. Something relatively new, though, we've been installing rmq on multiple servers for few years now and this issue seem to be introduced somewhere lately. Thanks for this workaround then. – Wiktor Zychla Feb 05 '16 at 14:57
  • Just to confirm, this is still an issue as of April 2017. Went through rounds and rounds of "homedir" and cookies and telnetting. This is the one solution that works (though maybe using the manual install from .ZIP may work as well). – JLB Apr 17 '17 at 16:42
  • 4
    @Jerdev What do you mean of the `Run RabbitMQ sbin command prompt as administrator`? – user7693832 Jul 04 '17 at 12:41
  • 6
    @244boy what he means is to run command prompt as administrator and navigate to the RabbitMQ\sbin folder. like C:\Program Files\RabbitMQ Server\rabbitmq_server-3.6.6\sbin Then run the commands to remove and reinstall the service. It worked for me. Thank you. – Elliot W Oct 18 '17 at 16:19
  • 3
    for me running above mentioned command followed by rabbitmq-server restart command worked. – sameer Mar 06 '18 at 13:11
  • What is `RabbitMQ sbin`? I don't find anything related to rabbit in `/sbin` – Alex Zhukovskiy Jun 28 '19 at 11:52
28

As @eddyP commented, I had two different Erlang cookie files:

  • A server cookie file, located at $env:WINDIR\system32\config\systemprofile\.erlang.cookie (prior to Erlang 20.2 it was located at $env:WINDIR\.erlang.cookie).
  • A client cookie file, located at $env:USERPROFILE\.erlang.cookie.

Copying the server cookie file over the client one, so that both files were the same, fixed the problem for me.

For further details, see "How Nodes (and CLI tools) Authenticate to Each Other: the Erlang Cookie".

Géry Ogam
  • 6,336
  • 4
  • 38
  • 67
sh87
  • 1,063
  • 10
  • 12
  • Works for me too. This is by far the simplest solution ! – Aditya Satyavada Feb 02 '17 at 12:31
  • 2
    When multiple install/uninstall could not help, this solution did help. Thanks. I copied from users to windows, but make sure both the files are same. – Megha Jaiswal Jun 15 '17 at 12:26
  • Possible duplicity with the https://stackoverflow.com/questions/40528775/rabbitmq-node-authentification-failed-after-changing-cookie-file/. – lapaczo Feb 12 '18 at 11:15
  • @Lapacho, this question/answer is not a duplicate. This question was asked Feb 1, 15. I posted my working answer on Sep 1, 2016. That question (https://stackoverflow.com/questions/40528775/rabbitmq-node-authentification-failed-after-changing-cookie-file/) was posted 2 months later (Nov 11, 2016). You added a comment on that question 1 year 3 months later (Feb 13, 2018). Which one, according to you, is a duplicate ? – sh87 Feb 14 '18 at 23:19
22

From RabbitMQ Command Prompt sbin (run as administrator) execute this command:

rabbitmq-server restart 
Andrei Karcheuski
  • 3,116
  • 3
  • 38
  • 39
  • 4
    This command is helpful. It showed me the location of the logs where I was able to find the real error (erlang version too old for me) – Hoppe Jan 28 '16 at 14:11
  • 3
    this is a blocking command.. server gets restarted fine but the command doesn't return to terminal.. had to do ctrl+q to exit out which stopped the server.. jerdev answer above worked very well – MoGun Feb 18 '16 at 16:59
13

In Windown, For some reason delete all folder in c:\Users\xxx\AppData\Roaming\RabbitMQ\db\ (xxx is your username) then flow @Jerdev answer and

  • start rabbitmq net start rabbitmq

  • check rabbitmq service rabbitmqctl status

nguyên
  • 5,156
  • 5
  • 43
  • 45
7

The same question on the RabbitMQ mailing list: https://groups.google.com/forum/#!topic/rabbitmq-users/0s1ExFhl4hM.

The Erlang cookie is used by rabbitmqctl as well as server nodes, so it may need being taken care of (placed in the correct location). See "Installing as a non-administrator user leaves .erlang.cookie in the wrong place" on Windows quirks.

Michael Klishin
  • 786
  • 3
  • 6
5

I resolve my problem doing this in Windows 10.

  1. Execute RabbitMQ Command Prompt (sbin dir) as administrator.
  2. Execute "rabbitmq-service remove" in (RabbitMQ Command Prompt).
  3. Execute %AppData% in Run Dialog Box of Windows.
  4. Delete all files in RabbitMQ folder.
  5. Execute "rabbitmq-service install" in (RabbitMQ Command Prompt).
  6. Execute "rabbitmqctl start_app" in (RabbitMQ Command Prompt).
ccassob
  • 335
  • 3
  • 10
3

If you come here looking for a linux answer for the same error message, try

sudo service rabbitmq-server start

(which is not a blocking command)

Maelmori
  • 31
  • 2
2

Just do the following:

  1. Uninstall rabbitmq and erlang.
  2. delete the rabbitmq folder existing in your appdata (if you dont know the appdata location, just type echo %AppData% in the command prompt)
  3. Then install erlang first and then rabbitmq.
  4. After installing, enable the management plugin using below command:

    rabbitmq-plugins enable rabbitmq_management

2

For me the cookies didnt match, like the other comments but the locations was in a different path for those having the same issue as me C:\Windows\System32\config\systemprofile

2

That is happening because rabbit MQ is not being installed correctly on Windows (and this error is misleading!). So to solve it do the following:

  1. type "cmd" in Cortana search or in "Run" for older version of Windows
  2. right click on in and choose "Run as Administrator"
  3. go to rabbit's sbin folder (cd "C:\Program Files\RabbitMQ Server\rabbitmq_server-3.7.4\sbin")
  4. run: rabbitmq-service remove
  5. run: rabbitmq-service install

now you can run 6. rabbitmq-plugins enable rabbitmq_management 7. rabbitmq-service start 8. and, finally, run: start http://localhost:15672 9. log on as user "guest" with password: "guest" and that's it. Happy Rabbiting!

2

I missed restarting my WINDOWS OS and then deleting the old version of ERLANG (which I uninstalled before restarting).

Somehow the fresh installation of Rabbit was referring to the old (un-installed version) and all the mismatch was happening. Clue was the 'services' referred Rabbit from the old ERLANG version.

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
1

This is how I resolved the error in my Windows 8 system:

Check for a syntax error in the rabbitmq.config file placed in the AppData folder for Windows.

How to check if there is any syntax error?

You can run rabbitmq-server restart from sbin folder in:
Program Files/RabbitMQ/rabbitmq_server_x.x/sbin/.

Replace the content of the rabbitmq.config with rabbitmq.config.example.

You may find the rabbitmq.config.example in:

Program Files/RabbitMQ/rabbitmq_server_x.x/etc/

Warning, you will lose the configuration you have saved previously with rabbitmq.

After changing the files, just hit

rabbitmq-server restart

in the sbin folder mentioned above.

Martin Evans
  • 45,791
  • 17
  • 81
  • 97
Sayan Biswas
  • 189
  • 1
  • 5