zoukankan      html  css  js  c++  java
  • celery定时任务启动报错

    启动celery时, 发现报错: KeyError: 'scheduler' KeyError: 'entries'

    [2020-12-15 14:53:11,669: ERROR/Beat] Process Beat
    Traceback (most recent call last):
      File "/home/clear/anaconda3/envs/faissEnv/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 "/home/clear/anaconda3/envs/faissEnv/lib/python3.6/shelve.py", line 111, in __getitem__
        value = self.cache[key]
    KeyError: 'entries'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/home/clear/anaconda3/envs/faissEnv/lib/python3.6/site-packages/billiard/process.py", line 327, in _bootstrap
        self.run()
      File "/home/clear/anaconda3/envs/faissEnv/lib/python3.6/site-packages/celery/beat.py", line 707, in run
        self.service.start(embedded_process=True)
      File "/home/clear/anaconda3/envs/faissEnv/lib/python3.6/site-packages/celery/beat.py", line 622, in start
        humanize_seconds(self.scheduler.max_interval))
      File "/home/clear/anaconda3/envs/faissEnv/lib/python3.6/site-packages/kombu/utils/objects.py", line 44, in __get__
        value = obj.__dict__[self.__name__] = self.__get(obj)
      File "/home/clear/anaconda3/envs/faissEnv/lib/python3.6/site-packages/celery/beat.py", line 666, in scheduler
        return self.get_scheduler()
      File "/home/clear/anaconda3/envs/faissEnv/lib/python3.6/site-packages/celery/beat.py", line 661, in get_scheduler
        lazy=lazy,
      File "/home/clear/anaconda3/envs/faissEnv/lib/python3.6/site-packages/celery/beat.py", line 501, in __init__
        Scheduler.__init__(self, *args, **kwargs)
      File "/home/clear/anaconda3/envs/faissEnv/lib/python3.6/site-packages/celery/beat.py", line 257, in __init__
        self.setup_schedule()
      File "/home/clear/anaconda3/envs/faissEnv/lib/python3.6/site-packages/celery/beat.py", line 529, in setup_schedule
        self._create_schedule()
      File "/home/clear/anaconda3/envs/faissEnv/lib/python3.6/site-packages/celery/beat.py", line 558, in _create_schedule
        self._store[str('entries')]
      File "/home/clear/anaconda3/envs/faissEnv/lib/python3.6/shelve.py", line 114, in __getitem__
        value = Unpickler(f).load()
    EOFError: Ran out of input
    

    解决办法:

    把celery启动目录中之前启动时自动生成的定时文件删除

    celerybeat-schedule.bak
    celerybeat-schedule.dat
    celerybeat-schedule.dir
    

  • 相关阅读:
    HDOJ 4276 The Ghost Blows Light
    Spring MVC程序中得到静态资源文件css,js,图片文件的路径问题总结
    $.ajax()方法详解
    jQuery Ajax 实例 ($.ajax、$.post、$.get)
    gitHub优秀android项目
    Android JSON
    SQL 设置自增,和default
    POST JSON fails with 415 Unsupported media type, SpringMVC
    23种设计模式
    转 Android_开源框架_AndroidUniversalImageLoader网络图片加载
  • 原文地址:https://www.cnblogs.com/gcxblogs/p/14669493.html
Copyright © 2011-2022 走看看