【问题标题】:django celery beat DBAccessErrordjango celery beat DBAccessError
【发布时间】:2015-01-01 14:00:54
【问题描述】:

我正在使用 celerybeat 运行 django+celery,但出现此错误

.../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

我使用python manage.py celeryd -B 运行 celery beat。 似乎运行 celery worker 不是问题,但 celerybeat worker 没有初始化。关于我在哪里可以找到 celery 尝试访问的数据库的任何建议?

我正在运行 django=1.5 和 django-celery==3.1.10

【问题讨论】:

    标签: python celery django-celery


    【解决方案1】:

    我问得太早了!

    回答我自己的问题,以防其他人遇到同样的问题。

    问题是因为我在运行 django 项目的文件夹中没有写权限。

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

    Beat 需要将任务的最后运行时间存储在本地 数据库文件(默认命名为 celerybeat-schedule),所以它需要 访问当前目录的写入权限

    通过运行修复了问题

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

    希望这对某人有所帮助。

    【讨论】:

      猜你喜欢
      • 2019-11-15
      • 1970-01-01
      • 1970-01-01
      • 2022-01-20
      • 2019-11-16
      • 2018-12-28
      • 2021-02-25
      • 1970-01-01
      • 2021-12-01
      相关资源
      最近更新 更多