gpt4 book ai didi

django - 如何修复 "Error Removing corrupted schedule file ' celerybeat-schedule' : error ('Bad magic number' , )r"

转载 作者:行者123 更新时间:2023-12-05 01:40:09 29 4
gpt4 key购买 nike

我在终端中使用命令可以正常运行celery beat,但是当我去aws中运行时,出现如下错误:

[2019-07-10 11:30:35,166: ERROR/MainProcess] Removing corrupted schedule file 'celerybeat-schedule': error('Bad magic number',)
Traceback (most recent call last):
File "/opt/python/run/venv/local/lib/python3.6/site-packages/kombu/utils/objects.py", line 42, in __get__
return obj.__dict__[self.__name__]
KeyError: 'scheduler'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/python/run/venv/local/lib/python3.6/site-packages/celery/beat.py", line 476, in setup_schedule
self._store = self._open_schedule()
File "/opt/python/run/venv/local/lib/python3.6/site-packages/celery/beat.py", line 466, in _open_schedule
return self.persistence.open(self.schedule_filename, writeback=True)
File "/usr/lib64/python3.6/shelve.py", line 243, in open
return DbfilenameShelf(filename, flag, protocol, writeback)
File "/usr/lib64/python3.6/shelve.py", line 227, in __init__
Shelf.__init__(self, dbm.open(filename, flag), protocol, writeback)
File "/usr/lib64/python3.6/dbm/__init__.py", line 94, in open
return mod.open(file, flag, mode)
_gdbm.error: Bad magic number

有人可以帮我弄清楚哪里出了问题吗?

最佳答案

取自site .

Beat 需要将任务的最后运行时间存储在本地数据库文件中(默认名为 celerybeat-schedule),因此它需要访问当前目录才能写入,或者您可以为此文件指定自定义位置:

celery -A proj beat -s/home/celery/var/run/celerybeat-schedule

关于django - 如何修复 "Error Removing corrupted schedule file ' celerybeat-schedule' : error ('Bad magic number' , )r",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56980069/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com