3

芹菜工作正常,有一天命令行工作人员无法启动以下跟踪:

Traceback (most recent call last):
  File "/home/buildslave/venv/bin/celery", line 9, in <module>
    load_entry_point('celery==3.0.7', 'console_scripts', 'celery')()
  File "/home/buildslave/venv/local/lib/python2.7/site-packages/celery/__main__.py", line 14, in main
    main()
  File "/home/buildslave/venv/local/lib/python2.7/site-packages/celery/bin/celery.py", line 942, in main
    cmd.execute_from_commandline(argv)
  File "/home/buildslave/venv/local/lib/python2.7/site-packages/celery/bin/celery.py", line 886, in execute_from_commandline
    super(CeleryCommand, self).execute_from_commandline(argv)))
  File "/home/buildslave/venv/local/lib/python2.7/site-packages/celery/bin/base.py", line 175, in execute_from_commandline
    return self.handle_argv(prog_name, argv[1:])
  File "/home/buildslave/venv/local/lib/python2.7/site-packages/celery/bin/celery.py", line 881, in handle_argv
    return self.execute(command, argv)
  File "/home/buildslave/venv/local/lib/python2.7/site-packages/celery/bin/celery.py", line 856, in execute
    return cls(app=self.app).run_from_argv(self.prog_name, argv)
  File "/home/buildslave/venv/local/lib/python2.7/site-packages/celery/bin/celery.py", line 142, in run_from_argv
    return self(*args, **options)
  File "/home/buildslave/venv/local/lib/python2.7/site-packages/celery/bin/celery.py", line 112, in __call__
    ret = self.run(*args, **kwargs)
  File "/home/buildslave/venv/local/lib/python2.7/site-packages/celery/bin/celery.py", line 214, in run
    return self.target.run(*args, **kwargs)
  File "/home/buildslave/venv/local/lib/python2.7/site-packages/celery/bin/celeryd.py", line 153, in run
    return self.app.Worker(**kwargs).run()
  File "/home/buildslave/venv/local/lib/python2.7/site-packages/celery/apps/worker.py", line 167, in run
    print(str(self.colored.cyan(' \n', self.startup_info())) +
  File "/home/buildslave/venv/local/lib/python2.7/site-packages/celery/apps/worker.py", line 234, in startup_info
    'conninfo': self.app.connection().as_uri(),
  File "/home/buildslave/venv/local/lib/python2.7/site-packages/kombu/connection.py", line 445, in as_uri
    fields = self.info()
  File "/home/buildslave/venv/local/lib/python2.7/site-packages/kombu/connection.py", line 434, in info
    return OrderedDict(self._info())
  File "/home/buildslave/venv/local/lib/python2.7/site-packages/kombu/connection.py", line 413, in _info
    D = self.transport.default_connection_params
  File "/home/buildslave/venv/local/lib/python2.7/site-packages/kombu/connection.py", line 636, in transport
    self._transport = self.create_transport()
  File "/home/buildslave/venv/local/lib/python2.7/site-packages/kombu/connection.py", line 395, in create_transport
    return self.get_transport_cls()(client=self)
  File "/home/buildslave/venv/local/lib/python2.7/site-packages/kombu/connection.py", line 402, in get_transport_cls
    transport_cls = get_transport_cls(transport_cls)
  File "/home/buildslave/venv/local/lib/python2.7/site-packages/kombu/transport/__init__.py", line 110, in get_transport_cls
    _transport_cache[transport] = _get_transport_cls(transport)
  File "/home/buildslave/venv/local/lib/python2.7/site-packages/kombu/transport/__init__.py", line 92, in _get_transport_cls
    transport_module_name, transport_cls_name = resolve_transport(transport)
  File "/home/buildslave/venv/local/lib/python2.7/site-packages/kombu/transport/__init__.py", line 87, in resolve_transport
    raise KeyError('No such transport: %s' % (transport, ))
KeyError: 'No such transport: amqp'

跟踪代码显示“amqp”神秘地失踪了kombu.transport.TRANSPORT_ALIASES——但这就是我失去踪迹的地方。

4

1 回答 1

7

该问题似乎是由于升级到 celery 3.0.7 造成的。以下为我解决了这个问题:

pip install kombu==2.4.0

注意:这似乎已由 kombu==2.4.3 per https://github.com/celery/kombu/commit/c3b7a0d885fef3a43b76af0881fee6b5d012923f解决

于 2012-08-24T19:45:13.250 回答