简体   繁体   English

django芹菜击败DBAccessError

[英]django celery beat DBAccessError

I am running django+celery with celerybeat, and i am getting this error 我正在用celerybeat运行django +芹菜,我收到了这个错误

.../local/lib/python2.7/site-packages/celery/beat.py", line 367, in setup_schedule
    writeback=True)
  File "/usr/lib/python2.7/shelve.py", line 239, in open
    return DbfilenameShelf(filename, flag, protocol, writeback)
  File "/usr/lib/python2.7/shelve.py", line 223, in __init__
    Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback)
  File "/usr/lib/python2.7/anydbm.py", line 85, in open
    return mod.open(file, flag, mode)
  File "/usr/lib/python2.7/dbhash.py", line 18, in open
    return bsddb.hashopen(file, flag, mode)
  File "/usr/lib/python2.7/bsddb/__init__.py", line 364, in hashopen
    d.open(file, db.DB_HASH, flags, mode)
DBAccessError: (13, 'Permission denied')
[2014-11-05 06:39:20,901: INFO/MainProcess] mingle: all alone

I used python manage.py celeryd -B to run celery beat. 我用python manage.py celeryd -B来运行芹菜拍。 It seems that running the celery worker is not the issue, but the celerybeat worker is not initialising. 看来,运行芹菜工作人员不是问题,但celerybeat工人未初始化。 any suggestions as to where i could find the database which celery is trying to access? 关于我在哪里可以找到芹菜试图访问的数据库的任何建议?

I'm running django=1.5 and django-celery==3.1.10 我正在运行django = 1.5和django-celery == 3.1.10

I asked too soon! 我太快问了!

answering my own question in case anyone else face the same issue. 回答我自己的问题,以防其他人遇到同样的问题。

The issue was because I did not have write permission in the folder my django project was running. 问题是因为我在django项目运行的文件夹中没有写权限。

from the documentation ( http://celery.readthedocs.org/en/latest/userguide/periodic-tasks.html#starting-the-scheduler ) 来自文档( http://celery.readthedocs.org/en/latest/userguide/periodic-tasks.html#starting-the-scheduler

Beat needs to store the last run times of the tasks in a local database file (named celerybeat-schedule by default), so it needs access to write in the current directory Beat需要将任务的最后运行时间存储在本地数据库文件中(默认名称为celerybeat-schedule),因此需要访问当前目录中的写入

fixed the issue by running 通过运行修复了问题

python manage.py celeryd -B -s /path/to/where/i/have/write-access/celerybeat-schedule

Hope that this helps someone. 希望这有助于某人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM