I've set up a Django project through Apache using mod_wsgi, and I'm now trying to add django-celery to the mix to run periodic and scheduled tasks. I'm running into occasional error messages, though, but I haven't found an explanation for what they mean.
When I start up Celerybeat using:
./manage.py celery beat
I often get one of the two following errors:
Message Error: cannot add item to database
celerybeat raised exception <class 'dbm.error'>: error('cannot add item to database',)
I can see that celerybeat generates two files in the project directory: celerybeat-schedule.dir and celerybeat-schedule.pag. I'm pretty sure these files are the "database" mentioned in the error message. If I delete these files, Celerybeat will usually run without problems for a couple times, but then the errors come back.
Is there something that I need to do with the celerybeat-schedule files to avoid this error? I thought it might be a permissions issue, but I couldn't see any issues.
just rm celerybeat.db, and start you celerybeat again will work
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With