227

I've installed the latest RabbitMQ server (rabbitmq-server-3.3.0-1.noarch.rpm) on a fresh Centos 5.10 VM according to the instructions on the official site.

I've done this many times before during development and never had any issues. However, this time I cannot log into the management web interface using the default guest/guest user.

In the logs, I see the following:

=ERROR REPORT==== 4-Apr-2014::00:55:15 ===
webmachine error: path="api/whoami"
"Unauthorized"

What could be causing this?

T .
  • 4,874
  • 3
  • 23
  • 36

6 Answers6

580

It's new features since the version 3.3.0 http://www.rabbitmq.com/release-notes/README-3.3.0.txt

server
------

...
25603 prevent access using the default guest/guest credentials except via
      localhost.

If you want enable the guest user read this or this RabbitMQ 3.3.1 can not login with guest/guest

# remove guest from loopback_users in rabbitmq.config like this
[{rabbit, [{loopback_users, []}]}].
# It is danger for default user and default password for remote access
# better to change password 
rabbitmqctl  change_password guest NEWPASSWORD

If you want create a new user with admin grants:

rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"

Now you can access using test test.

Community
  • 1
  • 1
Gabriele Santomaggio
  • 21,656
  • 4
  • 52
  • 52
  • 5
    Often checking firewall rules additionally to this answer solve the other wast of majority auth and connection errors. – pinepain Jul 18 '14 at 10:20
  • if you followed the instructions to create a new user but still get "login failed" then you may need to clear the browser cache (in firefox it is "clear recent history") and make sure to clear the "active logins" too. [See here for more info](http://stackoverflow.com/questions/23487238/rabbitmq-client-cant-connect-to-remote-rabbitmq-server#comment55133715_23487362) – Trevor Boyd Smith Nov 12 '15 at 20:07
  • I couldn't get guest working even though I sorted out the config file, but Im guessing I didn't have permissions set because once I set up this test account i was away running – Sweet Chilly Philly Sep 15 '16 at 22:56
  • I had a RMQ cluster with my LB managing the traffic, so I had to add the user to both the nodes (Master & Slave) for it to work properly. – Utsav Preet Nov 17 '19 at 08:21
74

If you still can't access the management console after a fresh install, check if the management console was enabled. To enable it:

  1. Go to the RabbitMQ command prompt.

  2. Type:

    rabbitmq-plugins enable rabbitmq_management
    
Pang
  • 9,564
  • 146
  • 81
  • 122
Robocide
  • 6,353
  • 4
  • 37
  • 41
  • 3
    This was the case after installing with Chocolatety on Windows 10. The installation script said the management plugin was enabled, but in reality, no plugins were enabled. – Eris Jun 20 '16 at 21:43
  • 5
    For dummies like myself: 1. Go to folder: C:\Program Files\RabbitMQ Server\rabbitmq_server-3.7.3\sbin. 2. run rabbitmq-plugins enable rabbitmq_management 3. go to services, restart rabbitmq service manually (or run rabbmimq-service restart) – Johnny Chu Feb 16 '18 at 22:13
  • Fixed it for me (note the timestamp). – HouseCat Jun 08 '18 at 01:20
  • fixed it. (you might need `sudo`) – Ali Yılmaz Jun 29 '18 at 12:06
  • 1
    With clean installation web interface wasn't enabled with given instructions under this answer. Was able to get to web interface however, guest user login was still not working. Followed the instructions given under this thread (https://stackoverflow.com/a/40845332/1132288) and able to login with the "test" user. – Pandurang Patil Aug 28 '19 at 10:13
14

Something that just happened to me and caused me some headaches:

I have set up a new Linux RabbitMQ server and used a shell script to set up my own custom users (not guest!).

The script had several of those "code" blocks:

rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"

Very similar to the one in Gabriele's answer, so I take his code and don't need to redact passwords.

Still I was not able to log in in the management console. Then I noticed that I had created the setup script in Windows (CR+LF line ending) and converted the file to Linux (LF only), then reran the setup script on my Linux server.

... and was still not able to log in, because it took another 15 minutes until I realized that calling add_user over and over again would not fix the broken passwords (which probably ended with a CR character). I had to call change_password for every user to fix my earlier mistake:

rabbitmqctl change_password test test

(Another solution would have been to delete all users and then call the script again)

Community
  • 1
  • 1
BlaM
  • 28,465
  • 32
  • 91
  • 105
2

If on Windows and installed using chocolatey make sure firewall is allowing the default ports for it:

netsh advfirewall firewall add rule name="RabbitMQ Management" dir=in action=allow protocol=TCP localport=15672
netsh advfirewall firewall add rule name="RabbitMQ" dir=in action=allow protocol=TCP localport=5672

for the remote access.

Nae
  • 14,209
  • 7
  • 52
  • 79
0

I also couldn't log in to Rabbit's web interface. in my case, cookies were disabled in the browser for this web interface. I allowed cookies to be saved and rebooted chrome. and I was able to log in again.

mailtime
  • 111
  • 1
  • 8
-2

If you are in Mac OS, you need to open the /usr/local/etc/rabbitmq/rabbitmq-env.conf and set NODE_IP_ADDRESS=, it used to be 127.0.0.1. Then add another user as the accepted answer suggested. After that, restart rabbitMQ, brew services restart rabbitmq