Getting celery beat error 'SchedulingError: Couldn't apply scheduled task'
See original GitHub issueHi, Thank you for writing a useful project for celery.
I am attempting to use this with scheduled tasks that run every minute that are configured in settings.py using celery beat config like below:
CELERYBEAT_SCHEDULE = {
'check_products': {
'task': 'com.ixlayer.tasks.check_products', 'schedule': timedelta(minutes=1),
},
}
However sometimes I get an exception in the process that runs celery beat.
Traceback (most recent call last):
File "/Users/kowsari/workspace/ixlayer-be/venv/lib/python2.7/site-packages/celery/beat.py", line 222, in apply_entry
result = self.apply_async(entry, producer=producer, advance=False)
File "/Users/kowsari/workspace/ixlayer-be/venv/lib/python2.7/site-packages/celery/beat.py", line 328, in apply_async
entry, exc=exc)), sys.exc_info()[2])
File "/Users/kowsari/workspace/ixlayer-be/venv/lib/python2.7/site-packages/celery/beat.py", line 320, in apply_async
**entry.options)
File "/Users/kowsari/workspace/ixlayer-be/venv/lib/python2.7/site-packages/celery_once/tasks.py", line 99, in apply_async
raise e
SchedulingError: Couldn't apply scheduled task check_products:
I am using this configuration.
app.conf.ONCE = {
'backend': 'celery_once.backends.Redis',
'settings': {
'url': settings.BROKER_URL,
'default_timeout': 60 * 60
}
}
Is this celerybeat getting the AlreadyQueued exception? Or is this something else? Help is much appreciated.
Thanks
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
django celery positional arguments celerybeat scheduling error
I'm having trouble getting celerybeat to schedule ...
Read more >Couldn't apply scheduled task babysit: [Errno 9] Bad file ...
Description of problem: Below exception appear in /var/log/messages every minute Version-Release number of selected component (if ...
Read more >Source code for celery.beat
This document describes the current stable version of Celery (5.2). For development docs, go here. Source code for celery.beat. """The periodic task scheduler." ......
Read more >Celery beat error. trying to make sense of it - Google Groups
I had this error below all over my celery beat log file, but I can't understand exactly WHERE/WHAT is the ... SchedulingError: Couldn't...
Read more >celery.beat 源代码
The task name name = None #: The schedule (run_every/crontab) schedule ... def _error_handler(exc, interval): error('Celerybeat: Connection error: %s.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I had a very similar problem with periodic task, and solution was to add
graceful=True
to its options:In my case
AlreadyQueued
exception was invisible due to logging config, so everything looked like a worker not picking up tasks.As a workaround, for now, I’d suggest using a pure celery task to trigger celery once task, i.e.
I don’t have the bandwidth currently to fix this, but a PR (while it may be tricky, please include a test case for a scheduled task to aid the review) is welcome.