Reputation: 3198
I am trying to run the following command
rabbitmq-plugins.bat enable rabbitmq_management
and its giving me an error like this:
11:36:55.464 [error] Failed to create cookie file 'h:/.erlang.cookie': enoent
I am using windows 7, Erlang Version R16B01 and RabbitMQ-Server version 3.1.5
I am using my work PC and our Corporate policy sets the HOMEDRIVE to h: and HOMEPATH to / and i dont think they will let me change this.
I can see the .erlang.cookie file under C:\Windows.
Could someone let me know of a workaround for this ?
Thanks in advance !
Upvotes: 33
Views: 34047
Reputation: 5739
Set the home drive to some dir in the dos shell before executing the cli.
Create a startup file, e.g start-rabbit.bat, with contents below.
set HOMEDRIVE=C:/conf/rabbitmq :: Or your favorite dir
rabbitmq-plugins.bat enable rabbitmq_management
Use a folder in C drive c:/conf/rabbitmq. The rabbitmq system will write the cookie file there.
It is a good idea not to dirty rabbitmq-xxx.bat installed files.
Upvotes: 48
Reputation: 719
I got the same error for Z:/ drive which didn't exist on my system. On checking %HOMEDRIVE%, it was mapped to Z:/.
The solution that worked for me was to execute below commands in CMD/Powershell(Admin mode).
Upvotes: 0
Reputation: 607
We had the same issue where group policies have set HOMEDRIVE to h: and HOMEPATH to /.
None of the other solutions here worked (even though we have seen that modifying the sys vars did work for us in a different environment).
Today we solved this by creating a new local Administrator account and installing from there.
Upvotes: 0
Reputation: 381
I solved the problem by following the steps below:
Open the file: "Program Files/RabbitMQ Server/rabbitmq_server-/sbin/rabbitmq-env"
At the end of the file, append the line:
REM Environment cleanup
set BOOT_MODULE=
set CONFIG_FILE=
set FEATURE_FLAGS_FILE=
set ENABLED_PLUGINS_FILE=
set LOG_BASE=
set MNESIA_BASE=
set PLUGINS_DIR=
set SCRIPT_DIR=
set SCRIPT_NAME=
set TDP0=
set HOMEDRIVE=C: <<< the new path of the .erlang.cookie
Open the RabbitMQ console
write:
4.1. rabbitmq-service stop
4.2. rabbitmq-service remove
4.3. rabbitmq-service install
4.4. rabbitmq-service start
Upvotes: 10
Reputation: 63
While this may seem totally obvious, you do need to run cmd "as administrator" - I was getting the above error until I remedied that. :-)
Upvotes: 2
Reputation: 801
There are cases when your HOMEDRIVE and HOMEPATH get overridden by group policy (active directory user) and than you'll need to set your HOMEDRIVE variable each time you want to start RabbitMQ service. In this case what you can do is:
rabbitmq-service remove
service
edit rabbitmq-service.bat file:
"!ERLANG_HOME!\bin\erl.exe" ^
-pa "!RABBITMQ_EBIN_ROOT!" ^
-boot !CLEAN_BOOT_FILE! ^
-noinput -hidden ^
-s rabbit_prelaunch ^
-setcookie "C:\Users\userName\" ^ <<< this is a place of your cookie
!RABBITMQ_NAME_TYPE! rabbitmqprelaunch!RANDOM!!TIME:~9!@localhost ^
-conf_advanced "!RABBITMQ_ADVANCED_CONFIG_FILE!" ^
..."
save the script
set HOMEDRIVE=C:\Users\userName
change homedrive before installing service
rabbitmq-service install
reinstall the service
now each time your reboot your service starts automatically and all paths are OK!
Upvotes: 5
Reputation: 1302
Find location of ".erlang.cookie" in your PC and run the commands bellow:
set HOMEDRIVE=[location of ".erlang.cookie"]
rabbitmq-plugins.bat enable rabbitmq_management
Upvotes: 7