0

I'm trying to get RabbitMQ working on my raspberry pi 2.

I've sucessfully installed RabbitMQ version 2.8.4 and I'm using python 2.7.3 and pika 0.9.14.

I've checked that RabbitMQ is running using sudo rabbitmqctl status

But when I try to run the code below

#!/usr/bin/env python
import pika

connection = pika.BlockingConnection(pika.ConnectionParameters(
    host='localhost'))
channel = connection.channel()

channel.queue_declare(queue='hello')

channel.basic_publish(exchange='',
                      routing_key='hello',
                      body='Hello World!')

connection.close()

I get the following error:

Traceback (most recent call last):
  File "/home/pi/python_2_7_pika_test.py", line 4, in <module>
    connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 130, in __init__
    super(BlockingConnection, self).__init__(parameters, None, False)
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/base_connection.py", line 72, in __init__
    on_close_callback)
  File "/usr/local/lib/python2.7/dist-packages/pika/connection.py", line 600, in __init__
    self.connect()
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 230, in connect
    error = self._adapter_connect()
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 309, in _adapter_connect
    self.process_data_events()
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 240, in process_data_events
    if self._handle_read():
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 348, in _handle_read
    super(BlockingConnection, self)._handle_read()
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/base_connection.py", line 343, in _handle_read
    return self._handle_error(error)
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/base_connection.py", line 302, in _handle_error
    self._handle_disconnect()
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/base_connection.py", line 248, in _handle_disconnect
    self._adapter_disconnect()
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 318, in _adapter_disconnect
    self._check_state_on_disconnect()
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 368, in _check_state_on_disconnect
    super(BlockingConnection, self)._check_state_on_disconnect()
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/base_connection.py", line 153, in _check_state_on_disconnect
    raise exceptions.ProbableAuthenticationError
ProbableAuthenticationError

I've googled but can't find anything relevant.

1 Answers1

2

Found the problem, I had changed the password for the RabbitMQ guest user.

  • Ref: http://stackoverflow.com/questions/30223339/pika-exceptions-probableauthenticationerror-when-trying-to-send-message-to-remot – Romain G Apr 28 '16 at 10:34