Can't install RabbitMQ on domain managed Windows: Failed to create cookie file 'q:/.erlang.cookie'

4,182 views
Skip to first unread message

bmitc...@gmail.com

unread,
Dec 19, 2014, 11:07:18 AM12/19/14
to rabbitm...@googlegroups.com
Hello,

I have come across what seems to be a very common issue of the RabbitMQ server install not being able to handle some domain managed home directories. I have Erlang installed, and I get the following values:
  • "init:get_argument(home) ." returns {ok,[["Q:\\"]]}
  • $env:ERLANG_HOME = C:\Program Files\erl6.3
  • $env:HOME = Q:\
  • $env:HOMEDRIVE = Q:
  • $env:HOMEPATH = \
When I install RabbitMQ (we're currently tied to version 3.3.5) using the installer EXE, it completes with no error, though I am somewhat positive I am seeing a crash dump generated in one of the command prompt windows that pops up. I double checked the ".erlang.cookie" file as mentioned here: https://www.rabbitmq.com/windows-quirks.html

The ".erlang.cookie" files in %SystemRoot% and %HOMEDRIVE%%HOMEPATH% are identical.

After all of this, I'm having tons of issues because of the "Failed to create cookie file 'q:/.erlang.cookie'" error. Running just "rabbitmqctl status" returns this error and a crash dump.

Can anyone help with this? Please do not suggest changing the environment variables HOMEDRIVE or HOMEPATH, as these are managed by our IT department and not editable unless we leave the domain. Leaving our domain is not acceptable either, as that is a large step to do just to install something.

Thank you for any help! I have tried Google searching and asking around internally, but I have spent enough time to just get it installed that I need some expertise help since I am still new to running with RabbitMQ.

Jean-Sébastien Pédron

unread,
Dec 19, 2014, 11:49:01 AM12/19/14
to rabbitm...@googlegroups.com
On 19.12.2014 17:07, bmitc...@gmail.com wrote:
> Hello,

Hi!

> I have come across what seems to be a very common issue of the RabbitMQ
> server install not being able to handle some domain managed home
> directories. I have Erlang installed, and I get the following values:
>
> * "init:get_argument(home) ." returns {ok,[["Q:\\"]]}
> * $env:ERLANG_HOME = C:\Program Files\erl6.3
> * $env:HOME = Q:\
> * $env:HOMEDRIVE = Q:
> * $env:HOMEPATH = \

Could it be a permission issue?

I have zero knowledge about Windows administration and domains, so what
I say could be non-sense :)

--
Jean-Sébastien Pédron
Pivotal / RabbitMQ

bmitc...@gmail.com

unread,
Dec 19, 2014, 12:55:08 PM12/19/14
to rabbitm...@googlegroups.com
I don't know, RabbitMQ just crashes and doesn't tell me anything. I am an administrator and can write to the Q: drive with no issues. RabbitMQ is the only thing that has ever had any issue like this with installing. Is there a way to change where RabbitMQ tries to create this cookie file? Why is that not configurable?

I must admit this is incredibly frustrating, as I have wasted a day trying to get a proper install and am becoming more and more behind in the development I am needing to do.

Michael Klishin

unread,
Dec 19, 2014, 1:11:28 PM12/19/14
to bmitc...@gmail.com, rabbitm...@googlegroups.com
See http://www.rabbitmq.com/windows-quirks.html.

MK

> On 19/12/2014, at 20:55, bmitc...@gmail.com wrote:
>
> I don't know, RabbitMQ just crashes and doesn't tell me anything. I am an administrator and can write to the Q: drive with no issues. RabbitMQ is the only thing that has ever had any issue like this with installing. Is there a way to change where RabbitMQ tries to create this cookie file? Why is that not configurable?
>
> I must admit this is incredibly frustrating, as I have wasted a day trying to get a proper install and am becoming more and more behind in the development I am needing to do.
>
> --
> You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
> To post to this group, send an email to rabbitm...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

bmitc...@gmail.com

unread,
Dec 19, 2014, 4:01:45 PM12/19/14
to rabbitm...@googlegroups.com, bmitc...@gmail.com
Yes, I know. I mentioned that link in my original post. I have already been there and verified that both workarounds do not work.

On Friday, December 19, 2014 12:11:28 PM UTC-6, Michael Klishin wrote:
See http://www.rabbitmq.com/windows-quirks.html.

MK

Michael Klishin

unread,
Dec 19, 2014, 4:09:42 PM12/19/14
to rabbitm...@googlegroups.com, bmitc...@gmail.com
On 20 December 2014 at 00:01:47, bmitc...@gmail.com (bmitc...@gmail.com) wrote:
> Yes, I know. I mentioned that link in my original post. I have
> already been there and verified that both workarounds do not
> work.

Every mailing list thread I could find with this message suggests it is a HOMEDRIVE/HOMEPATH issue.

If you have altered them, have you *re-sintalled* RabbitMQ service? (re-starting it is not enough).
--
MK

Staff Software Engineer, Pivotal/RabbitMQ

bmitc...@gmail.com

unread,
Dec 19, 2014, 4:23:30 PM12/19/14
to rabbitm...@googlegroups.com, bmitc...@gmail.com
Yes, but what is wrong with the path? The path is valid, and I have access to it. How is RabbitMQ trying to access this path? It is unclear what permissions RabbitMQ is trying to access the path with.

Is there any way to change where RabbitMQ is looking for this path at? I have not altered either the $Homedrive or $Homepath environment variables, as I cannot. These are managed by my company's IT department.

Hopefully there is a simple way to just tell RabbitMQ where to find the .erlang.cookie file (like in the Documents folder or something), as that would likely solve this issue. Can I copy it to somewhere else where RabbitMQ is also looking for it at?

Michael Klishin

unread,
Dec 19, 2014, 4:26:32 PM12/19/14
to rabbitm...@googlegroups.com, bmitc...@gmail.com
On 20 December 2014 at 00:23:31, bmitc...@gmail.com (bmitc...@gmail.com) wrote:
> Yes, but what is wrong with the path? The path is valid, and I have
> access to it. How is RabbitMQ trying to access this path? It is
> unclear what permissions RabbitMQ is trying to access the path
> with.

Erlang Cookie on http://www.rabbitmq.com/clustering.html.

> Is there any way to change where RabbitMQ is looking for this path
> at? I have not altered either the $Homedrive or $Homepath environment
> variables, as I cannot. These are managed by my company's IT department.
> Hopefully there is a simple way to just tell RabbitMQ where to
> find the .erlang.cookie file (like in the Documents folder or
> something), as that would likely solve this issue. Can I copy
> it to somewhere else where RabbitMQ is also looking for it at?

See above for some of the used locations and how you can provide a cookie
by modifying `rabbitmq-server.bat` to include `-setcookie [value]`.

Michael Levy

unread,
Dec 20, 2014, 10:54:09 AM12/20/14
to Michael Klishin, rabbitm...@googlegroups.com, bmitc...@gmail.com
is Q: a mapping to a network drive? Does the account running the rabbitmq service also have that mapping?

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send an email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
- Mike

Michael Levy
Microsoft Practice Director
michae...@sds-consulting.com
cell: 513.218.6696

Agility │ Mobility │ Usability
Custom development. Better results.
www.sds-consulting.com  

 Strategic Data Systems: Custom application development partner and technology resource that provides agile project leadership through an end-to-end team of experts in Requirements, User Interface, Application Design/Architecture, and Database Development.

NOTICE: This communication may contain confidential or privileged information. Do not print, copy, forward, or otherwise use the information for any unintended purpose. Also, if you are not the intended recipient, immediately notify the sender that you have received this email in error, and delete the copy you received. Thank you.

bmitc...@gmail.com

unread,
Dec 20, 2014, 4:49:15 PM12/20/14
to rabbitm...@googlegroups.com, mkli...@pivotal.io, bmitc...@gmail.com
Hi Mike. Yes, the Q: drive is mapping to a network drive. That is something I forgot to mention in my original post. However, I do have access to that mapping with my domain account, which is an administrator on my machine. I do not know the explicit privileges of the network drive directory (which looks something like "\\networkShare\users\myName"), but it is linked to my user name, and I have read/write access to it.

Someone mentioned that there could be a privilege discrepancy between my administrator account and who did the mapping (IT). Although, RabbitMQ is able to create a file there, as it's the one who creates the .erlang.cookie file in the first place. It is different from that in C:\windows\, but it does actually create a file. The service also "appears" to be running from the Services application. It's just that anytime I try to do a start, install, or status using the RabbitMQ batch scripts, I get the error. I have tried doing so from both an administrator command prompt and normal prompt.

I tried stopping the RabbitMQ service, changing the logon to use my domain account rather than the local system, but this causes RabbitMQ to terminate unexpectedly when you restart it from the Services utility in Windows.


On Saturday, December 20, 2014 9:54:09 AM UTC-6, Michael Levy wrote:
is Q: a mapping to a network drive? Does the account running the rabbitmq service also have that mapping?

Michael Levy

unread,
Dec 20, 2014, 5:36:59 PM12/20/14
to bmitc...@gmail.com, rabbitm...@googlegroups.com, Michael Klishin
Try launching cmd.exe as Local System (http://blogs.msdn.com/b/adioltean/archive/2004/11/27/271063.aspx) to see what the environment actually looks like.

Also, is there anything useful in the Windows Event Log?

-Mike

Hassan abu bakar

unread,
Dec 30, 2014, 2:46:49 AM12/30/14
to rabbitm...@googlegroups.com, bmitc...@gmail.com, mkli...@pivotal.io
I tried using the link that u gave me but i cannot make it to work. 

FYI I also have the same problem with the thread starter. In my case my profile is in Z drive because it was created by the sysadmin.

Om Shrivastava

unread,
Nov 10, 2015, 3:55:21 AM11/10/15
to rabbitmq-users, bmitc...@gmail.com

Cause of Issue: Issue is due to – current home drive is Q:\ and this a network drive.

Resolution: Changed HomeDrive then reinstall RabbitMQ Service.

        Step to change home drive

  1. If using Local system/laptop

    1. disconnect network connection

    2. Disconnect Network drive from my computer

    3. Restart system

  2. If remote system/server (can’t disconnect network)

    1. Login as local system administrator

Verify using windows => Run => %HomeDrive% should open local drive not network drive.

bmitc...@gmail.com

unread,
Nov 18, 2015, 11:28:38 PM11/18/15
to rabbitmq-users, bmitc...@gmail.com
Please read my initial post. This is NOT a valid solution because not all users have access to their HOMEDRIVE and HOMEPATH variables. For people on managed domains (i.e., anybody working for any decently sized company), they do not have permissions to change these variables.

I clearly stated to not suggest this. This was still a problem at my previous company that never reached resolution, and I am certain it will end up biting the project once the product (which uses RabbitMQ as a dependency) starts getting installed on customer systems. Suggesting a customer to create a totally separate user account just to install software is not a solution either.

This is likely a problem with permissions and the way the Erlang and RabbitMQ setup scripts run. The fix should lie within either of those systems, as they should be flexible to various HOMEDRIVE and HOMEPATH setups. If a user has access to both locations, these two should be able to install files there with no issues.

Michael Klishin

unread,
Nov 18, 2015, 11:55:56 PM11/18/15
to rabbitm...@googlegroups.com, bmitc...@gmail.com
If you feel so strongly about this, feel free to look into it, RabbitMQ is an open source project.

Jens Eriksen

unread,
Nov 19, 2015, 6:46:28 AM11/19/15
to rabbitmq-users, bmitc...@gmail.com
I had the same problem, but solved it using Michaels tip:

.......
See above for some of the used locations and how you can provide a cookie 
by modifying `rabbitmq-server.bat` to include `-setcookie [value]`.

What you should do is to uninstall the windows service:

rabbitmq-service remove

Then edit the rabbitmq-service.bat file like below:

"!ERLANG_HOME!\bin\erl.exe" ^
        -pa "!RABBITMQ_EBIN_ROOT!" ^
        -noinput -hidden ^
        -s rabbit_prelaunch ^
	-setcookie "c:\" ^        <---  add this line to where you want the .erlang.cookie to be placed.
        !RABBITMQ_NAME_TYPE! rabbitmqprelaunch!RANDOM!!TIME:~9!

Now save the script and reinstall the service by calling:

rabbitmq-service install

Hope that helps
/Jens

Jean-Sébastien Pédron

unread,
Nov 23, 2015, 3:14:06 AM11/23/15
to rabbitm...@googlegroups.com
On 19/11/2015 12:46, Jens Eriksen wrote:
> -setcookie "c:\" ^ <--- add this line to where you want the .erlang.cookie to be placed.

Be careful, "-setcookie" doesn't take the location of the cookie but the
value itself. So by doing "-setcookie C:\Path\To\cookie.txt", the cookie
is the string "C:\Path\To\cookie.txt", not the content of the pointed file.

swing...@hotmail.com

unread,
Aug 23, 2016, 12:51:08 PM8/23/16
to rabbitmq-users, bmitc...@gmail.com
Make sure you are not opening a command prompt as an administrator.  The local server administrator account doesn't have access to network shares.  The title of the command prompt window should not say: "Administrator: Command Prompt".  Once I opened the command prompt as myself I stopped getting the error you mentioned.  However, I did copy the cookie file manually to my %Homeshare% network drive first, but I don't think that was necessary.

Joseph Casale

unread,
Aug 23, 2016, 2:53:39 PM8/23/16
to rabbitm...@googlegroups.com, bmitc...@gmail.com
On Tue, Aug 23, 2016 at 10:51 AM,  <swing...@hotmail.com> wrote:
> Make sure you are not opening a command prompt as an administrator.  The
> local server administrator account doesn't have access to network shares.
> The title of the command prompt window should not say: "Administrator:
> Command Prompt".  Once I opened the command prompt as myself I stopped
> getting the error you mentioned.  However, I did copy the cookie file
> manually to my %Homeshare% network drive first, but I don't think that was
> necessary.

Elevated accounts certainly do have network access, the context granted for the
elevated shell just doesn't have your session entitlements (if you are a local admin
and the console is just elevated, otherwise its a completely different user).

The nuances with an elevated shell and boundaries don't have any effect on the
problem you describe. You can map a drive after elevation if the context for which
that shell has been started with is entitled with access.

More often than not you actually *need* to start the shell elevated otherwise
it won't have sufficient access to local resources.

The erlang magic cookie and its location requirements exist in either scenario.

https://technet.microsoft.com/en-ca/library/ee844140%28v=ws.10%29.aspx?f=255&MSPPError=-2147217396

jlc

Eric Aldinger

unread,
Aug 23, 2016, 6:49:05 PM8/23/16
to rabbitmq-users, bmitc...@gmail.com

You can install as a service or run as an application. Per the Windows installation guide "The service will run in the security context of the system account without the need for a user to be logged in on a console. This is normally more appropriate for production use. The server should not be run as a service and application simultaneously. The service runs using the rabbitmq-service.bat script in sbin. "

 

One gotcha that arises from this is that Rabbit uses a combination of the HomePath and HomeDrive environment variables to locate the erlang cookie, per user. The service account running a RabbitMQ service and any accounts accessing the service bat files must share the erlang cookie. Ideally everyone should locate the cookie in the same drive and folder (using symbolic links via mklink perhaps). If your service accounts have machine level login rights (which I would NOT recommend) you could always log into the machine as the service account for all maintenance. 

In order to properly manage this cookie for a multiple user accounts , I simply did this.

 

copy-item -force $env:windir\.erlang.cookie C:$env:homepath


Also note that Erlang cares about the  to determine the location to store the erlang cookie for EPMD processes.

Reply all
Reply to author
Forward
0 new messages