3
私はCeleryベースのアプリケーションで作業しており、main関数内から作業者を開始したいと考えています。ここでは、コードの非常に単純化されたバージョンは次のとおりです。Python Celery worker_main "RuntimeError:最大再帰深度を超えました"
from celery import Celery
class CoolApp(object):
def __init__(self):
self.app = Celery('test', 'amqp://[email protected]/')
test = CoolApp()
test.app.worker_main()
これはRuntimeError: maximum recursion depth exceeded in cmp
エラーを生成し、私は理由を理解することはできません。助けてください。
トレースバック:
Traceback (most recent call last):
File "test.py", line 9, in <module>
test.app.worker_main()
File "/usr/lib/python2.7/site-packages/celery/app/base.py", line 368, in worker_main
).execute_from_commandline(argv)
File "/usr/lib/python2.7/site-packages/celery/bin/base.py", line 281, in execute_from_commandline
return self.handle_argv(self.prog_name, argv[1:])
File "/usr/lib/python2.7/site-packages/celery/bin/base.py", line 367, in handle_argv
*self.parse_options(prog_name, argv, command))
File "/usr/lib/python2.7/site-packages/celery/bin/base.py", line 403, in parse_options
self.parser = self.create_parser(prog_name, command)
File "/usr/lib/python2.7/site-packages/celery/bin/base.py", line 419, in create_parser
self.add_arguments(parser)
File "/usr/lib/python2.7/site-packages/celery/bin/worker.py", line 275, in add_arguments
default=conf.worker_state_db,
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 130, in __getattr__
return self[k]
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 431, in __getitem__
return getitem(k)
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 280, in __getitem__
return mapping[_key]
File "/usr/lib64/python2.7/UserDict.py", line 19, in __getitem__
if key in self.data:
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 130, in __getattr__
return self[k]
File "/usr/lib64/python2.7/UserDict.py", line 19, in __getitem__
if key in self.data:
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 130, in __getattr__
return self[k]
File "/usr/lib64/python2.7/UserDict.py", line 19, in __getitem__
if key in self.data:
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 130, in __getattr__
return self[k]
File "/usr/lib64/python2.7/UserDict.py", line 19, in __getitem__
if key in self.data:
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 130, in __getattr__
return self[k]
File "/usr/lib64/python2.7/UserDict.py", line 19, in __getitem__
if key in self.data:
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 130, in __getattr__
return self[k]
File "/usr/lib64/python2.7/UserDict.py", line 19, in __getitem__
if key in self.data:
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 130, in __getattr__
return self[k]
File "/usr/lib64/python2.7/UserDict.py", line 19, in __getitem__
if key in self.data:
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 130, in __getattr__
return self[k]
File "/usr/lib64/python2.7/UserDict.py", line 19, in __getitem__
if key in self.data:
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 130, in __getattr__
return self[k]
File "/usr/lib64/python2.7/UserDict.py", line 19, in __getitem__
if key in self.data:
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 130, in __getattr__
return self[k]
File "/usr/lib64/python2.7/UserDict.py", line 19, in __getitem__
if key in self.data:
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 130, in __getattr__
return self[k]
File "/usr/lib64/python2.7/UserDict.py", line 19, in __getitem__
if key in self.data:
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 130, in __getattr__
return self[k]
File "/usr/lib64/python2.7/UserDict.py", line 19, in __getitem__
if key in self.data:
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 130, in __getattr__
return self[k]
File "/usr/lib64/python2.7/UserDict.py", line 19, in __getitem__
if key in self.data:
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 130, in __getattr__
return self[k]
File "/usr/lib64/python2.7/UserDict.py", line 19, in __getitem__
if key in self.data:
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 130, in __getattr__
return self[k]
File "/usr/lib64/python2.7/UserDict.py", line 19, in __getitem__
if key in self.data:
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 130, in __getattr__
return self[k]
File "/usr/lib64/python2.7/UserDict.py", line 19, in __getitem__
if key in self.data:
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 130, in __getattr__
return self[k]
File "/usr/lib64/python2.7/UserDict.py", line 19, in __getitem__
if key in self.data:
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 130, in __getattr__
return self[k]
File "/usr/lib64/python2.7/UserDict.py", line 19, in __getitem__
if key in self.data:
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 130, in __getattr__
return self[k]
...
File "/usr/lib64/python2.7/UserDict.py", line 19, in __getitem__
if key in self.data:
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 130, in __getattr__
return self[k]
File "/usr/lib64/python2.7/UserDict.py", line 19, in __getitem__
if key in self.data:
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 130, in __getattr__
return self[k]
File "/usr/lib64/python2.7/UserDict.py", line 19, in __getitem__
if key in self.data:
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 130, in __getattr__
return self[k]
File "/usr/lib64/python2.7/UserDict.py", line 19, in __getitem__
if key in self.data:
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 130, in __getattr__
return self[k]
File "/usr/lib64/python2.7/UserDict.py", line 19, in __getitem__
if key in self.data:
File "/usr/lib/python2.7/site-packages/celery/utils/collections.py", line 130, in __getattr__
return self[k]
File "/usr/lib64/python2.7/UserDict.py", line 19, in __getitem__
if key in self.data:
File "/usr/lib/python2.7/site-packages/kombu/utils/objects.py", line 44, in __get__
value = obj.__dict__[self.__name__] = self.__get(obj)
File "/usr/lib/python2.7/site-packages/celery/app/base.py", line 148, in data
return self.callback()
File "/usr/lib/python2.7/site-packages/celery/app/base.py", line 910, in _finalize_pending_conf
conf = self._conf = self._load_config()
File "/usr/lib/python2.7/site-packages/celery/app/base.py", line 923, in _load_config
self.prepare_config(self.loader.conf), self._preconf,
File "/usr/lib/python2.7/site-packages/kombu/utils/objects.py", line 44, in __get__
value = obj.__dict__[self.__name__] = self.__get(obj)
File "/usr/lib/python2.7/site-packages/celery/app/base.py", line 1208, in loader
return get_loader_cls(self.loader_cls)(app=self)
File "/usr/lib/python2.7/site-packages/celery/loaders/__init__.py", line 21, in get_loader_cls
return symbol_by_name(loader, LOADER_ALIASES, imp=import_from_cwd)
File "/usr/lib/python2.7/site-packages/kombu/utils/imports.py", line 56, in symbol_by_name
module = imp(module_name, package=package, **kwargs)
File "/usr/lib/python2.7/site-packages/celery/utils/imports.py", line 100, in import_from_cwd
with cwd_in_path():
File "/usr/lib64/python2.7/contextlib.py", line 17, in __enter__
return self.gen.next()
File "/usr/lib/python2.7/site-packages/celery/utils/imports.py", line 60, in cwd_in_path
if cwd in sys.path:
RuntimeError: maximum recursion depth exceeded in cmp
Red Hat Enterprise Linux Workstationリリース7.3(Maipo)でセロリ4.0.2を使用 – Jordan
私も同じ問題に直面しています。誰か助けてもらえますか? ありがとうございました:) –