Not finding erlang cookie on default windows location

1,748 views
Skip to first unread message

Jorge Ribeiro

unread,
Jan 12, 2021, 9:58:53 AM1/12/21
to rabbitmq-users
Hello Everyone,

I am having a problem with my RabbitMQ server 3.7.17 installation.
I am installing it on Windows 10, with the Erlang 10.4 32 bits version, but I can't find the erlang cookie on the default location.

I am a beginner and I have been looking for possible causes, but haven't been able to find a solution. Can anyone help me with this?

Thank you,
Jorge Ribeiro

Luke Bakken

unread,
Jan 12, 2021, 11:42:19 AM1/12/21
to rabbitmq-users
Hello,

Please use the latest versions of RabbitMQ and Erlang. You can find up-to-date Erlang binaries for Windows here - https://erlang.org/download/otp_versions_tree.html

I used the following search to find documentation on where the cookie is located on Windows - https://www.google.com/search?q=site%3Arabbitmq.com+windows+cookie


Once the RabbitMQ service has started, the cookie should be located here:

%SystemRoot%\system32\config\systemprofile\.erlang.cookie

Thanks,
Luke

Jorge Ribeiro

unread,
Jan 12, 2021, 11:57:30 AM1/12/21
to rabbitmq-users
Hello Luke,

Thank you for your answer, but I have seen the documentation and I never find the cookie in the referred possible locations, when the service starts.
I have also tried with the latest versions of both Erlang and RabbitMQ, but no luck.

Luke Bakken

unread,
Jan 12, 2021, 12:45:07 PM1/12/21
to rabbitmq-users
At this point you must help us help you. We don't have time to guess what may be wrong in your environment.

What exactly have you tried? Be detailed!
Are you sure RabbitMQ starts correctly? Can you provide logs?
Can you run the copy command I provided? Get a transcript of the command and the output. Either take a screenshot or save it in a file.
What files are in the %SystemRoot%\system32\config\systemprofile directory?

Jorge Ribeiro

unread,
Jan 12, 2021, 1:33:23 PM1/12/21
to rabbitmq-users
I have used the command "rabbitmq-diagnostics status", but the output is this:

output_rabbit.PNG

I have tried copying the cookie that is created in the user home directory to the windows folder, to remove the service and install it again (with "rabbitmq-service remove" and "rabbitmq-service install") and to use the latest versions of both RabbitMQ and Erlang. The only way I could make it work was with the 64 bits version of Erlang.
Attached goes the log from the from the service start and with the "rabbitmq-diagnostics status" command execution.
In the directory %SystemRoot%\system32\config\systemprofile, there's nothing but a folder named "AppData".

Thank you for your time.
RABBIT~1.LOG

Luke Bakken

unread,
Jan 12, 2021, 2:01:31 PM1/12/21
to rabbitmq-users
Thank you for the rabbitmq-diagnostics status output. Please note that you did not provide all of the information I requested. In order to assist you, please do that from here on out.

You can clearly see the "check the Erlang cookie" message. That is more than likely the problem.

Please follow these instructions exactly:
  • Log in using the administrative account you use to install RabbitMQ.
  • Un-install both RabbitMQ and Erlang.
  • Run these commands (capture the command and the output and include in your response:
del %SystemRoot%\system32\config\systemprofile\.erlang.cookie
del %HOMEDRIVE%%HOMEPATH%\.erlang.cookie
  • Restart your machine
  • Re-login using the same administrative account you use to install RabbitMQ
  • Install Erlang
  • Install RabbitMQ
  • Confirm that the .erlang.cookie file is in this location:
%SystemRoot%\system32\config\systemprofile\.erlang.cookie
  • Copy that file to your user's home directory:
copy %SystemRoot%\system32\config\systemprofile\.erlang.cookie %HOMEDRIVE%%HOMEPATH%\.erlang.cookie

Thanks,
Luke

Jorge Ribeiro

unread,
Jan 13, 2021, 5:24:17 AM1/13/21
to rabbitmq-users
Hello again,

I followed the instructions as requested and below is the output of said commands.
commands.PNG

After installing both Erlang and RabbitMQ again, I checked if the cookie was in that location, but it had nothing again, as you can see below.
systemprofile.PNG

Thank you,
Jorge

Luke Bakken

unread,
Jan 13, 2021, 8:36:24 AM1/13/21
to rabbitmq-users
Thanks for the information.

Please note that the Explorer hides certain files, including those that start with a dot. Log in using your administrative user, open an administrative command prompt, and run this command:

copy %SystemRoot%\system32\config\systemprofile\.erlang.cookie %HOMEDRIVE%%HOMEPATH%\.erlang.cookie

Take a screenshot of the command being run and the output.

The reason I think that the cookie file is there is the following output from the logs you provided earlier. Notice the "home dir" value:

 Starting RabbitMQ 3.7.17 on Erlang 22.0
 Copyright (C) 2007-2019 Pivotal Software, Inc.
 Licensed under the MPL.  See https://www.rabbitmq.com/
2021-01-12 18:18:49.800 [info] <0.249.0> 
 node           : rabbit@DESKTOP-C3I1AF2
 home dir       : C:\WINDOWS\system32\config\systemprofile
 config file(s) : c:/Users/efacec/AppData/Roaming/RabbitMQ/advanced.config
 cookie hash    : HeAu+znIaCTF7d0aJsBPbg==
 log(s)         : C:/Users/efacec/AppData/Roaming/RabbitMQ/log/RABBIT~1.LOG
                : C:/Users/efacec/AppData/Roaming/RabbitMQ/log/rabbit@DESKTOP-C3I1AF2_upgrade.log
 database dir   : c:/Users/efacec/AppData/Roaming/RabbitMQ/db/RABBIT~1

The output of the copy command will tell us if it's there or not. If not, it means that RabbitMQ did not start and we can investigate that next.

Thanks,
Luke

Jorge Ribeiro

unread,
Jan 13, 2021, 8:47:52 AM1/13/21
to rabbitmq-users
I see. I ran the command but it says the system cannot find the file.
command.PNG

What should I do next?

Thank you,
Jorge

Luke Bakken

unread,
Jan 13, 2021, 10:31:25 AM1/13/21
to rabbitmq-users
This means that the RabbitMQ service is not starting correctly.

You can try to start RabbitMQ in a console window, which may give us more information. Please do the following:
  • Log in as your admin user, and open an admin prompt.
  • Create or edit the %AppData%\RabbitMQ\rabbitmq.conf file to add these lines:
log.console = true
log.console.level = debug                                              
log.file.level = debug
  • Change your current directory to the RabbitMQ server directory in C:\Program Files\RabbitMQ Server\rabbitmq_server-X.Y.Z
  • Run the following commands:
set LOG=debug
set RABBITMQ_ALLOW_INPUT=true
.\sbin\rabbitmq-server.bat

A window will pop up showing the startup of RabbitMQ. Please copy all of the text into a file and attach the file to your response. In addition, attach any log files from %AppData%\RabbitMQ

Thanks,
Luke

Jorge Ribeiro

unread,
Jan 13, 2021, 11:00:52 AM1/13/21
to rabbitmq-users
Ok, here goes attached the file with the text and all the log files from %AppData%\RabbitMQ.

Thank you,
Jorge

rabbitmq startup text and logs.zip

Luke Bakken

unread,
Jan 13, 2021, 4:39:44 PM1/13/21
to rabbitmq-users
Hello,

RabbitMQ appears to be starting correctly from the command line. Please note you are using 32-bit Erlang which is not recommended:

2021-01-13 10:14:47.284 [warning] <0.282.0> You are using a 32-bit version of Erlang: you may run into memory address~nspace exhaustion or statistic counters overflow.

There are only three places on Windows where Erlang / RabbitMQ will look for a cookie file:

C:\Users\efacec\.erlang.cookie (since this is the user you used to install RabbitMQ)
C:\Windows\.erlang.cookie (this is a deprecated location but it may be the one used by 32-bit Erlang)
C:\WINDOWS\system32\config\systemprofile\.erlang.cookie

If the file exists in your user's home directory, copy it to the other two locations. Then, run a file checksum to ensure all three files are identical. Then, start the RabbitMQ windows service and run the following command:

rabbitmqctl.bat status

It should work. If it doesn't, remove all traces of RabbitMQ and Erlang, and start over with the newest versions. Be sure to use 64-bit Erlang unless you really are using a 32-bit machine.

Jorge Ribeiro

unread,
Jan 14, 2021, 8:24:22 AM1/14/21
to rabbitmq-users
Hello,

After copying the files to the other two locations, I did the file checksum and, for some reason, the one in "C:\WINDOWS\system32\config\systemprofile\.erlang.cookie" doesn't have the same hash value.
How can I ensure that it doesn't change when copying?

Thank you,
Jorge

Luke Bakken

unread,
Jan 14, 2021, 9:06:24 AM1/14/21
to rabbitmq-users
Hello -

What is the output from all of the copy commands and your checksum commands?

Can you copy the file from C:\WINDOWS\system32\config\systemprofile\.erlang.cookie to the other two locations and have the checksum remain the same?

It doesn't matter as long as all three files are identical.

My guess is you have some sort of system protection that is preventing changes to files within C:\WINDOWS\system32

Thanks,
Luke

Jorge Ribeiro

unread,
Jan 14, 2021, 9:31:29 AM1/14/21
to rabbitmq-users
Copying from "C:\WINDOWS\system32\config\systemprofile\.erlang.cookie" doesn't keem them the same.

The copy and the checksum commands below:
copycmd.PNG
checksum.PNG

Maybe there really is some system protection, I'll have to check on that.

Thank you,
Jorge

Luke Bakken

unread,
Jan 14, 2021, 10:04:29 AM1/14/21
to rabbitmq-users
Hi Jorge,

I've never seen this behavior in any of the Windows systems I use to test RabbitMQ. My main system is Windows 10 Pro, for what that's worth.

You can set the cookie as an Erlang VM argument and bypass the cookie file by doing this:
  • Log in using the same account used to install RabbitMQ
  • Create the %AppData%\RabbitMQ\rabbitmq-env-conf.bat file with this content:
set CTL_ERL_ARGS=-setcookie MYCOOKIE
set SERVER_ADDITIONAL_ERL_ARGS=-setcookie MYCOOKIE

Note that the cookie string can be any ASCII string of characters.
  • Open an administrative command prompt, and change to the RabbitMQ server installation directory.
  • Run these commands:
.\sbin\rabbitmq-service.bat stop
.\sbin\rabbitmq-service.bat remove
.\sbin\rabbitmq-service.bat install
.\sbin\rabbitmq-service.bat start
.\sbin\rabbitmqctl.bat status

You should see a successful status output.

Let me know how it goes -
Thanks
Luke

Jorge Ribeiro

unread,
Jan 14, 2021, 10:22:01 AM1/14/21
to rabbitmq-users
Hi Luke,

I found what the problem was. I searched why would the file have a different hash inside the system32 folder from the same file outside it and found this question and corresponding explanation:
Having read that I copied the file to the folder "C:\Windows\SysWOW64\config\systemprofile" and it solved the problem.

Thank you very much for your help,
Jorge

Luke Bakken

unread,
Jan 14, 2021, 10:33:54 AM1/14/21
to rabbitmq-users
Hello,

I'm curious, why are you using 32-bit Erlang? That is why the actual file is in SysWOW64.

Jorge Ribeiro

unread,
Jan 14, 2021, 10:52:22 AM1/14/21
to rabbitmq-users
Hi,

Well, I am using the 32-bit Erlang because it is installed as a prerequisite for a software that my team is developing and it is supposed to work with both the 32-bit and 64-bit versions of windows.

Luke Bakken

unread,
Jan 14, 2021, 11:02:00 AM1/14/21
to rabbitmq-users
Thank you for following up. I should have realized that the 32-bit redirection was the source of the problem but it is extremely rare for people to use 32-bit Erlang these days which is why I didn't realize it right away.

Jorge Ribeiro

unread,
Jan 14, 2021, 11:09:26 AM1/14/21
to rabbitmq-users
No problem, I understand. Thank you for the help anyway because it lead me to find the answer.
Reply all
Reply to author
Forward
0 new messages