I’m using the django celery task queue, and it works fine in development, but not at all in wsgi production. Even more frustrating, it used to work in production, but I somehow broke it.
“sudo rabbitmqctl status” tells me that the rabbitmq server is working. Everything also seems peachy in django: objects are created, and routed to the task manager without problems. But then their status just stays as “queued” indefinitely. The way I’ve written my code, they should switch to “error” or “ready,” as soon as anything gets returned from the celery task. So I assume there’s something wrong with the queue.
Two related questions:
- Any ideas what the problem might be?
- How do I debug celery? Outside of the manage.py celeryd command, I’m not sure how to peer into its inner workings. Are there log files or something I can use?
Thanks!
PS – I’ve seen this question, but he seems to want to run celery from manage.py, not wsgi.
After much searching, the most complete answer I found for this question is here. These directions flesh out the skimpy official directions for daemonizing celeryd. I’ll copy the gist here, but you should follow the link, because Michael has explained some parts in more detail.
The main idea is that you need scripts in three places:
Settings.py appears to be the same as in development mode. So if that’s already set up, there are four steps to shifting to production:
https://github.com/celery/celery/tree/3.0/extra/generic-init.d/
http://docs.celeryproject.org/en/latest/tutorials/daemonizing.html#example-django-configuration
This solved my problem.