Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django Celery Error When Starting CeleryBeat - Cannot Add Item To Database

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.

like image 274
kromenak Avatar asked Sep 11 '12 02:09

kromenak


1 Answers

just rm celerybeat.db, and start you celerybeat again will work

like image 178
Pengfei.X Avatar answered Oct 06 '22 02:10

Pengfei.X