Pregunta

I am connecting a remote worker to my Celery server (Django) for the first time. On my server, I have created a new username and password for a user, and set the permissions:

# rabbitmqctl add_user adcelery pwd
# rabbitmqctl set_permissions adcelery "^adcelery-.*" ".*" ".*"
# rabbitmqctl list_users
Listing users ...
guest   [administrator]
adcelery    []
...done.
# /etc/init.d/rabbitmq-server restart
# /etc/init.d/celeryd restart

My remote worker's URL:

BROKER_URL = "amqp://adcelery:pwd@mydomain.com/"

I am getting the following error on the startup of my remote worker. When I set "guest:guest" as my login in the BROKER_URL above, it connects perfectly fine. I'm sure I'm missing a step or two, any suggestions?

[2014-01-12 11:31:26,188: INFO/MainProcess] Connected to amqp://adcelery@awaaz.de:5672//
[2014-01-12 11:31:26,391: ERROR/MainProcess] Unrecoverable error: AccessRefused(403, u"ACCESS_REFUSED - access to exchange 'celeryev' in vhost '/' refused f
or user 'adcelery'", (40, 10), 'Exchange.declare')
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/celery/worker/__init__.py", line 206, in start
    self.blueprint.start(self)
  File "/usr/local/lib/python2.7/dist-packages/celery/bootsteps.py", line 123, in start
    step.start(parent)
  File "/usr/local/lib/python2.7/dist-packages/celery/bootsteps.py", line 373, in start
    return self.obj.start()
  File "/usr/local/lib/python2.7/dist-packages/celery/worker/consumer.py", line 270, in start
    blueprint.start(self)
  File "/usr/local/lib/python2.7/dist-packages/celery/bootsteps.py", line 123, in start
    step.start(parent)
  File "/usr/local/lib/python2.7/dist-packages/celery/worker/consumer.py", line 498, in start
    enabled=self.send_events, groups=self.groups,
  File "/usr/local/lib/python2.7/dist-packages/celery/events/__init__.py", line 150, in __init__
    self.enable()
  File "/usr/local/lib/python2.7/dist-packages/celery/events/__init__.py", line 169, in enable
    serializer=self.serializer)
  File "/usr/local/lib/python2.7/dist-packages/kombu/messaging.py", line 82, in __init__
    self.revive(self._channel)
  File "/usr/local/lib/python2.7/dist-packages/kombu/messaging.py", line 216, in revive
    self.declare()
  File "/usr/local/lib/python2.7/dist-packages/kombu/messaging.py", line 102, in declare
    self.exchange.declare()
  File "/usr/local/lib/python2.7/dist-packages/kombu/entity.py", line 166, in declare
    nowait=nowait, passive=passive,
  File "/usr/local/lib/python2.7/dist-packages/amqp/channel.py", line 612, in exchange_declare
    (40, 11),  # Channel.exchange_declare_ok
  File "/usr/local/lib/python2.7/dist-packages/amqp/abstract_channel.py", line 75, in wait
    return self.dispatch_method(method_sig, args, content)
  File "/usr/local/lib/python2.7/dist-packages/amqp/abstract_channel.py", line 93, in dispatch_method
   return amqp_method(self, args)
  File "/usr/local/lib/python2.7/dist-packages/amqp/channel.py", line 232, in _close
    reply_code, reply_text, (class_id, method_id), ChannelError,
AccessRefused: Exchange.declare: (403) ACCESS_REFUSED - access to exchange 'celeryev' in vhost '/' refused for user 'adcelery'
¿Fue útil?

Solución

Just found the answer in the docs. Need to add the user to the vhost:

rabbitmqctl set_permissions -p / adcelery ".*" ".*" ".*"
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top