Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access refused for user rabbitmq & celery

I create vhost:

rabbitmqctl add_vhost test

Then user:

rabbitmqctl add_user user 123456

Then I take permissions to that user:

rabbitmqctl set_permissions -p test user "test" "test" "test"

I use Celery, in tasks.py:

app = Celery('tasks', broker='amqp://user:123456@localhost/test', backend='amqp://user:123456@localhost/test')

Then I run:

celery -A tasks worker --loglevel=info

I have error:

amqp.exceptions.AccessRefused: Exchange.declare: (403) ACCESS_REFUSED - access to exchange 'celeryev' in vhost 'test' refused for user 'user'

How to fix that?

like image 332
Lev Avatar asked Oct 20 '14 17:10

Lev


1 Answers

Take a look at set_permissions here: https://www.rabbitmq.com/rabbitmqctl.8.html#Access_control

When you call set_permissions you are passing "test" for configure, read and write, so your user will be able to only use a queue/exchange by the name "test"

Also, take a look at this link as well: https://www.rabbitmq.com/access-control.html

like image 157
old_sound Avatar answered Oct 20 '22 00:10

old_sound