RabbitMQ da un “acceso denegado, se negaron entrada para el usuario” error al intentar seguir el tutorial de apio

StackOverflow https://stackoverflow.com/questions/1878306

Pregunta

Estoy intentando seguir la apio tutorial , pero correr en un problema cuando corro python manage.py celeryd: mi servidor RabbitMQ (instalado en una máquina virtual en mi caja dev) no permitirá que mi nombre de usuario

.

Me sale el siguiente en mi consola de administración de Django:

[ERROR/MainProcess] AMQP Listener: Connection Error: Socket closed. Trying again in 2 seconds...

y esto se manifiesta en mi archivo rabbit.log en mi servidor RabbitMQ:

exception on TCP connection <0.5814.0> from $DJANGO_BOX_IP
{channel0_error,starting,{amqp,access_refused,"login refused for user '$CONFIGURED_USER'",'connection.start_ok'}}

He comprobado mi doble de usuario, permisos, y la información de host virtual, y todos parecen coincidir. Cualquier ayuda de solución de problemas está muy apreciada.

ACTUALIZACIÓN: Siguiendo el consejo de @asksol me sale el siguiente rastreo:

$MY_VIRTUAL_ENV/lib/python2.6/site-packages/carrot/connection.pyc in connection(self)
    118             return
    119         if not self._connection:
--> 120             self._connection = self._establish_connection()
    121             self._closed = False
    122         return self._connection

$MY_VIRTUAL_ENV/lib/python2.6/site-packages/carrot/connection.pyc in _establish_connection(self)
    131 
    132     def _establish_connection(self):
--> 133         return self.create_backend().establish_connection()
    134 
    135     def get_backend_cls(self):

$MY_VIRTUAL_ENV/lib/python2.6/site-packages/carrot/backends/pyamqplib.pyc in establish_connection(self)
    110                                insist=conninfo.insist,
    111                                ssl=conninfo.ssl,
--> 112                                connect_timeout=conninfo.connect_timeout)
    113 
    114     def close_connection(self, connection):

$MY_VIRTUAL_ENV/lib/python2.6/site-packages/amqplib/client_0_8/connection.pyc in __init__(self, host, userid, password, login_method, login_response, virtual_host, locale, client_properties, ssl, insist, connect_timeout, **kwargs)
    138                 self.wait(allowed_methods=[
    139                     (10, 20), # secure
--> 140                     (10, 30), # tune
    141                     ])
    142 

$MY_VIRTUAL_ENV/lib/python2.6/site-packages/amqplib/client_0_8/abstract_channel.pyc in wait(self, allowed_methods)
     88         method_sig, args, content = self.connection._wait_method(
---> 89             self.channel_id, allowed_methods)
     90 
     91         if content \

$MY_VIRTUAL_ENV/lib/python2.6/site-packages/amqplib/client_0_8/connection.pyc in _wait_method(self, channel_id, allowed_methods)
    196         while True:
    197             channel, method_sig, args, content = \
--> 198                 self.method_reader.read_method()
    199 
    200             if (channel == channel_id) \

$MY_VIRTUAL_ENV/lib/python2.6/site-packages/amqplib/client_0_8/method_framing.pyc in read_method(self)
    213         m = self.queue.get()
    214         if isinstance(m, Exception):
--> 215             raise m
    216         return m
    217 

IOError: Socket closed
¿Fue útil?

Solución

¿Está ejecutando Django? Si es así, intente lo siguiente:

>>> from carrot.connection import DjangoBrokerConnection
>>> c = DjangoBrokerConnection()
>>> c.connection

¿Da lo mismo? ¿Seguro que va a conectar al nombre de host correcto, y que el nombre de usuario y contraseña tiene acceso a la máquina virtual?

ACTUALIZACIÓN:

>>> from carrot.connection import DjangoBrokerConnection
>>> c = DjangoBrokerConnection()
>>> for n in ("host", "userid", "password", "virtual_host", "ssl"):
...     print("%s -> %s" % (n, repr(getattr(c, n, None))))

ACTUALIZACIÓN: Ud. Tiene que hacer lo anterior antes de ejecutar c.connection, tal como se establece la conexión con pereza en la zanahoria

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top