Celerybeat not executing periodic tasks

Cerin picture Cerin · Jun 12, 2013 · Viewed 13.9k times · Source

How do you diagnose why manage.py celerybeat won't execute any tasks?

I'm running celerybeat via supervisord with the command:

/usr/local/myapp/src/manage.py celerybeat --schedule=/tmp/celerybeat-schedule-myapp --pidfile=/tmp/celerybeat-myapp.pid --loglevel=INFO

Supervisord appears to run celerybeat just fine, and the log file shows:

[2013-06-12 13:17:12,540: INFO/MainProcess] Celerybeat: Starting...
[2013-06-12 13:17:12,571: WARNING/MainProcess] Reset: Account for new __version__ field
[2013-06-12 13:17:12,571: WARNING/MainProcess] Reset: Account for new tz field
[2013-06-12 13:17:12,572: WARNING/MainProcess] Reset: Account for new utc_enabled field

I have several periodic tasks showing as enabled on http://localhost:8000/admin/djcelery/periodictask which should run every few minutes. However, the celerybeat log never shows anything being executed. Why would this be?

Answer

YoK picture YoK · Aug 13, 2013

celerybeat will just schecdule task, wont execute it. To execute task you need to also start worker. You can start celery beat as well as worker together. I use "celeryd -B"

In your case it should look like:

/usr/local/myapp/src/manage.py celery worker --beat --schedule=/tmp/celerybeat-schedule-myapp --pidfile=/tmp/celerybeat-myapp.pid --loglevel=INFO

or

/usr/local/myapp/src/manage.py celeryd -B --schedule=/tmp/celerybeat-schedule-myapp --pidfile=/tmp/celerybeat-myapp.pid --loglevel=INFO