pika.exceptions.ProbableAuthenticationError when trying to send message to remote queue

冷暖自知 提交于 2019-12-01 03:42:46

问题


I'm trying to run RabbitMQ Python tutorial but with sender on virtualbox host machine and receiver and queue on virtualbox guest machine. So I modified mentioned send.py code by only replacing localhost with 192.168.1.5. When I run it, i receive following error:

...
  File "/home/damian/.virtualenvs/kivy_1.9/local/lib/python2.7/site-packages/pika/adapters/base_connection.py", line 153, in _check_state_on_disconnect
    raise exceptions.ProbableAuthenticationError
pika.exceptions.ProbableAuthenticationError

rabbitmq-server seems to be running, because when I stop it send.py gives me:

...
  File "/home/damian/.virtualenvs/kivy_1.9/local/lib/python2.7/site-packages/pika/adapters/blocking_connection.py", line 301, in _adapter_connect
    raise exceptions.AMQPConnectionError(error)
pika.exceptions.AMQPConnectionError: Connection to 192.168.1.5:5672 failed: [Errno 111] Connection refused

which makes perfect sense.

How to fix that ProbableAuthenticationError?

Host machine is Debian 7 with Python 2.7.3 and pika 0.9.14, guest is Ubuntu 15.04 with rabbitmq-server 3.4.3-2


回答1:


This is because you are trying to authenticate using the username and password guest remotely. Starting with RabbitMQ 3.3 you need to create a new account to use remotely, and guest/guest can only be used locally.

This is taken from the change log here.

25603 prevent access using the default guest/guest credentials except via localhost since (1.0.0)

It's possible to modify the RabbitMQ configuration to allow remote access using the guest account, by removing guest from loopback_users, but it's recommended to create a new user to follow best practices.

[{rabbit, [{loopback_users, []}]}].


来源:https://stackoverflow.com/questions/30223339/pika-exceptions-probableauthenticationerror-when-trying-to-send-message-to-remot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!