Getting RabbitMQ authentication failing even with cookie is set - rabbitmq

I have recently installed rabbitmq with ErlanOTP on Windows 10 running on lattePanda
I ran rabbitmqctl status and got the following error:
C:\Program Files\RabbitMQ Server\rabbitmq_server-3.7.5\sbin>rabbitmqctl status
Status of node rabbit#DESKTOP-V6GQ6RF ...
Error: unable to perform an operation on node 'rabbit#DESKTOP-V6GQ6RF'. 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:
See the CLI, clustering and networking guides on http://rabbitmq.com/documentation.html to learn more
Consult server logs on node rabbit#DESKTOP-V6GQ6RF
DIAGNOSTICS
attempted to contact: ['rabbit#DESKTOP-V6GQ6RF']
rabbit#DESKTOP-V6GQ6RF:
connected to epmd (port 4369) on DESKTOP-V6GQ6RF
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: 'rabbitmqcli2#DESKTOP-V6GQ6RF'
effective user's home directory: C:\Users\LattePanda
Erlang cookie hash: 8Kq9f/AaeixMvahU4G2v8A==
How can I get RabbitMQ up and running?
While trouble-shooting I discovered this thread https://groups.google.com/forum/#!topic/rabbitmq-users/a6sqrAUX_Fg
and set the environment variable to Erlang Cookie I found in %HOMEDRIVE%%HOMEPATH%\.erlang.cookie but it still doesn't seem to work.

The RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.
It is important to copy the cookie from the correct location. This document explains where it is located based on Erlang version and Windows version. You don't mention which Erlang version you are using, but I suspect you will want to copy the C:\WINDOWS\system32\config\systemprofile\.erlang.cookie file to %HOMEDRIVE%%HOMEPATH%\.erlang.cookie. You should not have to set any environment variables so if you have, I recommend removing them and restarting your server.

Related

Unable to start rabbitmq-server on centos7

I installed RabbitMQ on centos7, but when I start the server I get a warning:
Warning: PID file not written; -detached was passed.
then I check the status of rabbitmq server I get such message
centos Error: unable to perform an operation on node 'rabbit#ecs-8767'. 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:
* See the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more
* Consult server logs on node rabbit#ecs-8767
* If target node is configured to use long node names, don't forget to use --longnames with CLI tools
DIAGNOSTICS
Does your user have a permission to write folder /var/run? If the user doesn't have a permission, you can try to start with sudo.
Also you can try another method in this link:
https://serverfault.com/questions/159334/what-permissions-are-needed-to-write-a-pid-file-in-var-run/159349#159349

Rabbitmq nodes not able to join cluster?

Below are the commands executed and error stack:
[root#DGTLSITTIBCO2 ~]# rabbitmqctl join_cluster rabbit#DGTLSITTIBCO1
Clustering node rabbit#DGTLSITTIBCO2 with rabbit#DGTLSITTIBCO1 Error:
unable to perform an operation on node 'rabbit#DGTLSITTIBCO1'. 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:
See the CLI, clustering and networking guides on rabbitmq documentation to learn more
Consult server logs on node rabbit#DGTLSITTIBCO1
DIAGNOSTICS
attempted to contact: [rabbit#DGTLSITTIBCO1]
rabbit#DGTLSITTIBCO1:
connected to epmd (port 4369) on DGTLSITTIBCO1
epmd reports node 'rabbit' uses port 25672 for inter-node and CLI tool traffic
TCP connection succeeded but Erlang distribution failed
TCP connection to remote host has timed out. Is the Erlang distribution using TLS?
Current node details:
node name: rabbitmqcli57#DGTLSITTIBCO2
effective user's home directory: /var/lib/rabbitmq
Erlang cookie hash: ci1chJoiyrDKCLOj2TDxaA==
Please see my answer in the rabbitmq-users mailing list. In short, your Erlang cookies are most likely not synchronized.
Generally, it's not very helpful to paste an error into your message without any other information. The people helping out on this list like to know what version of RabbitMQ and Erlang you're using and on what operating system, and a description of what you're trying to do.
Anyway, in this case, your issue is one of the most commonly reported on this list. If you search for the string Error: unable to perform an operation on node, you'll see many replies with suggestions on how to fix your issue.
The RabbitMQ team also maintains documentation, including a troubleshooting document: https://www.rabbitmq.com/troubleshooting.html
You should also read the Clustering Guide, specifically this section: https://www.rabbitmq.com/clustering.html#erlang-cookie

How is erlang.cookie and rabbitmq related?

I have accidentally deleted erlang.cookie and i cannot restart RabbitMQ server? What is the best way to make the server running again.
The erlang cookie is a token needed by rabbitmq to use clustering. That's why he is required on server start.
Go to /var/lib/rabbitmq and check if .erlang.cookie is still here.
If not, try running
rabbitmqctl shutdown
rabbitmq-server
Considering the erlang doc this should regenerate your cookie.
The first action of the Erlang network authentication server (auth) is then to read a file named $HOME/.erlang.cookie. If the file does not exist, it is created.
If this doesn't work, try to reboot the host, and if this still doesn't work can you post more details about the error message, and run
rabbitmqctl status
and show us what it gives you.

Unable to connect to local RabbitMQ on Windows 10

I've installed RabbitMQ (latest version downloadable from RabbitMQ website) on my Windows 10 machine. It installed with ERlang 19.1.
I'm trying to install RabbitMQ Web UI Management Tools using the following command (using RabbitMQ Command Prompt):
rabbitmq-plugins enable rabbitmq_management
I'm getting the following error:
The directory name is invalid.
The filename, directory name, or volume label syntax is incorrect.
The filename, directory name, or volume label syntax is incorrect.
Plugin configuration unchanged.
Applying plugin configuration to rabbit#[0x7FF9A8527044]... failed.
* Could not contact node rabbit#[0x7FF9A8527044].
Changes will take effect at broker restart.
* Options: --online - fail if broker cannot be contacted.
--offline - do not try to contact broker.
I've looked up on SO and tried stopping and restarting, overriding erlang cookie, but nothing helps.
I think there's a problem with RabbitMQ itself. The service itself is marked as started, but if I try to telnet the default port (5672) then it fails (it's not a firewall issue - I've disabled it).
Also I don't see an log files created for RabbitMQ or any related Event Logs messages. So it's hard to diagnose exactly the problem.
I also tried uninstalling and re-install both erlang and RabbitMQ. Still didn't help.
How do I further diagnose the problem?
Found a solution to the problem (downgrading Erlang did not work in my case, but just in case I left it on Erlang 18 in case there were other issues with ver 19).
What puzzled my eye was this line: Applying plugin configuration to rabbit#[0x7FF9A8527044]... failed.. Seems like it's trying to connect to rabbit instance at a wrong machine name.
I then ran rabbitmqctl.bat status which failed but again showed that it's trying to connect to [0x7FF9A8527044] while the node name was rabbit#my-mchine-name. So I started reading the configuration section at RabbitMQ website and the solution was simple - setting the node name manually.
All I had to do is add an environment variable named RABBITMQ_NODENAME with the node name being rabbit#localhost. And that's it. Problem solved!
you may be running into issues with Erlang 19 incompatibility. there has been some history of Erlang 19 support problems with RMQ. Try installing Erlang 18 instead.
If that fails, I would recommend using Docker for Windows and installing / running RabbitMQ in that. I've moved all my services like RabbitMQ, MongoDB, etc. into Docker containers and it's made my life as a dev so much simpler.
In my case I had to trash the local account config located at : %APPDATA%\RabbitMQ\.
Deleting the entire folder and reinstalling the service did the trick.
Rabbitmq 3.6.14
Erlang 20.1 OTP

Error to Connect RabbitMq in hyperic HQ

I am trying to monitor a machine in which RabbitMQ is installed.RabbitMQ's broker is working well in that machine.
Now I want to monitor that machine using open source HypricHQ software.
The problem is the HypricHQ server can't find my RabbitMQ broker.My Hypric Agent is also working fine, i.e. in HypricHQ server the detail of RabbitMQ machine is showing.
I have checked the error in agent.log file the error logged in that file is:
2011-05-30 15:24:16,549 INFO [Thread-1] [SingleConnectionFactory] Established shared Rabbit Connection: org.springframework.erlang.connection.DefaultConnection#1265109
2011-05-30 15:24:16,574 ERROR [Thread-1] [AutoScan] AutoScan failed for RabbitMQ
org.springframework.erlang.ErlangBadRpcException: {badrpc,{'EXIT',{undef,[{rabbit_access_control,list_vhosts,[]},{rpc,'-handle_call_call/6-fun-0-',5}]}}}
at org.hyperic.hq.plugin.rabbitmq.core.HypericErlangTemplate.executeRpcAndConvert(HypericErlangTemplate.java:72)
at org.hyperic.hq.plugin.rabbitmq.core.HypericRabbitAdmin.getVirtualHosts(HypericRabbitAdmin.java:75)
at org.hyperic.hq.plugin.rabbitmq.detect.RabbitServerDetector.getServerResources(RabbitServerDetector.java:106)
at org.hyperic.hq.autoinventory.scanimpl.NullScan.scan(NullScan.java:83)
at org.hyperic.hq.autoinventory.Scanner.start(Scanner.java:198)
at org.hyperic.hq.autoinventory.ScanManager.mainRunLoop(ScanManager.java:141)
at org.hyperic.hq.autoinventory.ScanManager.access$000(ScanManager.java:41)
at org.hyperic.hq.autoinventory.ScanManager$1.run(ScanManager.java:107)
Why this error occure?
How can I overcome this error? The OS I am using is Windows 7.
Maybe it needs your broker to have the rabbitmq-management plugin installed?
Log into the server running the RabbitMQ broker and type
sudo rabbitmqctl status
Check that the version is one that is supported by Hypric. A lot of Linux distros have a very old version of RabbitMQ installed. It is easy enough to upgrade using the .deb or .rpm binaries on the RabbitMQ site so you should consider doing that.