Django Celery Beat sending many-per-hour tasks but not daily tasks
This is a really weird situation. Tasks that are scheduled to run every several minutes every hour of the day (e.g. "*/20 * * * *") are being sent to Celery (with entries in Celery Beat's log) and Celery is running them. Tasks that are to be run once per day (e.g. "15 11 * * *") are not happening at their designated times though, and nothing is being written to Celery Beat's log for those.
I have checked the contents of the tables in the database, and everything looks right, except, of course, that last_run_at
is null for the tasks that are not being sent.
# select * from django_celery_beat_periodictask where id=7;
id | name | task | args | kwargs | queue | exchange | routing_key | expires | enabled | last_run_at | total_run_count | date_changed | description | crontab_id | interval_id | solar_id | one_off | start_time | priority | headers | clocked_id | expire_seconds
----+----------------------------------------------+---------------------------------+------+--------+-------+----------+-------------+---------+---------+-------------+-----------------+-------------------------------+-------------+------------+-------------+----------+---------+------------+----------+---------+------------+----------------
7 | hub_builtin__dhmaintenance.tasks.rotate_logs | dhmaintenance.tasks.rotate_logs | [] | {} | | | | | t | | 0 | 2025-09-25 04:39:20.172338+00 | | 6 | | | f | | | {} | |
# select * from django_celery_beat_crontabschedule where id=6;
id | minute | hour | day_of_week | day_of_month | month_of_year | timezone
----+--------+------+-------------+--------------+---------------+----------
6 | 30 | 0 | * | * | * | UTC
It turns out the problem was that I upgraded django-celery-beat
and did not also upgrade cron-descriptor
(was at v1.4.5). After I upgraded cron-descriptor
to version 2.0.6, I stopped experiencing the problem. All tasks, including those with once-per-day schedules were sent to Celery at their scheduled times.
pip install
did not complain about that because django-celery-beat
's requirement is for cron-descriptor>=1.2.32
, even though that is obviously not appropriate, given what I have experienced.