4

I tried to search the relative questions on stackoverflow and on google but didn't find something which could solve my issue.

I have BROKER_URL set in my /etc/default/celeryd configuration as redis. BROKER_URL="redis://localhost:6379"

But when I start /etc/init.d/celeryd start

it says: "ERROR/MainProcess] consumer: Cannot connect to amqp://guest@127.0.0.1:5672//:"

Also on the docs page I saw about celeryconfig.py. I don't understand why should I have two config files? /etc/default/celeryd is there for configuration.

Keshav Agrawal
  • 577
  • 9
  • 23

2 Answers2

4

You can try CELERY_BROKER_URL instead of BROKER_URL if you set the namespace like app.config_from_object("django.conf:settings", namespace="CELERY").

Ref: http://docs.celeryproject.org/en/latest/history/whatsnew-4.0.html#latentcall-django-admonition

kigawas
  • 1,153
  • 14
  • 27
1

Make sure you're not setting broker when defining your app. This one bit me when I copied and pasted code from the tutorial. It took me hours to realize I was overriding my own configuration with this line:

app = Celery('tasks', broker='amqp://guest@localhost//')

It should say this:

app = Celery('tasks')
wolverdude
  • 1,583
  • 1
  • 13
  • 20