I'm trying to setup production Django app with Celery and Rabbit-MQ but I'm having issues with authentication. I have added a user myuser :
sudo rabbitmqctl add_user myuser mypassword
sudo rabbitmqctl add_vhost myvhost
sudo rabbitmqctl set_user_tags myuser mytag
sudo rabbitmqctl set_permissions -p myvhost myuser ".*" ".*" ".*"
If I run sudo rabbitmqctl authenticate_user myuser , it authenticates successfully. But my Django application cannot authenticate:
2024-03-05 00:43:37.630 [info] <0.2106.0> accepting AMQP connection <0.2106.0> (127.0.0.1:42276 -> 127.0.0.1:5672)
2024-03-05 00:43:37.631 [error] <0.2106.0> Error on AMQP connection <0.2106.0> (127.0.0.1:42276 -> 127.0.0.1:5672, state: starting):
PLAIN login refused: user 'myuser' - invalid credentials
2024-03-05 00:43:37.632 [info] <0.2106.0> closing AMQP connection <0.2106.0> (127.0.0.1:42276 -> 127.0.0.1:5672)
My celery runner URL:
CELERY_BROKER_URL = 'amqp://myuser:mypassword@localhost:5672/myvhost'
Any idea what could cause it? Rabbit-mq is installed with default settings. Celery and Django are running systemd .