question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

amqplib transport gives KeyError: 'No such transport: amqp'

See original GitHub issue

Celery 3.0.7, Kombu 2.4.2

BROKER_URL is “amqplib://user:pass@celery-1:5672//”

Don’t have librabbitmq installed.

(dragon)ubuntu@web-3:~$ django-admin.py celery status
Traceback (most recent call last):
  File "/home/ubuntu/dragon/bin/django-admin.py", line 5, in <module>
    management.execute_from_command_line()
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/djcelery/management/commands/celery.py", line 22, in run_from_argv
    ["%s %s" % (argv[0], argv[1])] + argv[2:])
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/celery/bin/celery.py", line 886, in execute_from_commandline
    super(CeleryCommand, self).execute_from_commandline(argv)))
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/celery/bin/base.py", line 175, in execute_from_commandline
    return self.handle_argv(prog_name, argv[1:])
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/celery/bin/celery.py", line 881, in handle_argv
    return self.execute(command, argv)
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/celery/bin/celery.py", line 856, in execute
    return cls(app=self.app).run_from_argv(self.prog_name, argv)
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/celery/bin/celery.py", line 142, in run_from_argv
    return self(*args, **options)
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/celery/bin/celery.py", line 112, in __call__
    ret = self.run(*args, **kwargs)
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/celery/bin/celery.py", line 651, in run
    .run('ping', **dict(kwargs, quiet=True, show_body=False))
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/celery/bin/celery.py", line 504, in run
    return self.do_call_method(args, **kwargs)
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/celery/bin/celery.py", line 526, in do_call_method
    replies = handler(method, *args[1:], **kwargs)
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/celery/bin/celery.py", line 569, in call
    return getattr(i, method)(*args)
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/celery/app/control.py", line 79, in ping
    return self._request('ping')
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/celery/app/control.py", line 54, in _request
    timeout=self.timeout, reply=True))
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/celery/app/control.py", line 260, in broadcast
    channel=channel)
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/kombu/pidbox.py", line 213, in _broadcast
    chan = channel or self.connection.default_channel
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/kombu/connection.py", line 623, in default_channel
    self.connection
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/kombu/connection.py", line 616, in connection
    self._connection = self._establish_connection()
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/kombu/connection.py", line 575, in _establish_connection
    conn = self.transport.establish_connection()
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/kombu/connection.py", line 636, in transport
    self._transport = self.create_transport()
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/kombu/connection.py", line 395, in create_transport
    return self.get_transport_cls()(client=self)
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/kombu/connection.py", line 402, in get_transport_cls
    transport_cls = get_transport_cls(transport_cls)
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/kombu/transport/__init__.py", line 107, in get_transport_cls
    _transport_cache[transport] = _get_transport_cls(transport)
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/kombu/transport/__init__.py", line 89, in _get_transport_cls
    transport_module_name, transport_cls_name = resolve_transport(transport)
  File "/home/ubuntu/dragon/lib/python2.6/site-packages/kombu/transport/__init__.py", line 84, in resolve_transport
    raise KeyError('No such transport: %s' % (transport, ))
KeyError: 'No such transport: amqp'

Issue Analytics

  • State:closed
  • Created 11 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
askcommented, Aug 25, 2012

That is very strange… what is the value of BROKER_URL?

I get this:

>>> import kombu
>>> kombu.__version__
'2.4.2'
>>> Connection('amqp://localhost').connect()
<Connection: guest:guest@localhost:5672//>
>>> Connection('amqplib://localhost').connect()
<kombu.transport.amqplib.Connection object at 0x101396ad0>
>>> Connection('amqplib://localhost').clone().connect()
<Connection: guest:guest@stdout:5672//>
>>> Connection('amqp://localhost').clone().connect()
<Connection: guest:guest@stdout:5672//>
0reactions
prayagupacommented, Nov 28, 2020

Thank you @ask, REPL code you posted was helpful for debugging (me being non python dev). I was struggling with similar issue while using airflow+celery. For me it happened to be broker_url was single quoted in airflow.conf but should not be.

For airflow users you can debug using following code in python REPL,

from airflow import configuration
import kombu
configuration_dict = configuration.as_dict(display_sensitive=True)
broker = configuration_dict.get('celery').get('broker_url')
rmq_conn = kombu.Connection(broker)
rmq_conn.connect()
rmq_conn.close()
Read more comments on GitHub >

github_iconTop Results From Across the Web

Celery Error 'No such transport: amqp' - python - Stack Overflow
The problem appears to be due to an upgrade to celery 3.0.7. The following resolved the issue for me: pip install kombu==2.4.0.
Read more >
[traceback] KeyError: 'No such transport: ampq' - mkt.receipts ...
steps to reproduce: 1. On your unagi phone, navigate to the details page of a packaged app 2. Try to install the app...
Read more >
Change history — Kombu 5.2.4 documentation - Celery
Allow getting recoverable_connection_errors without an active transport. Prevent KeyError: 'purelib' by removing INSTALLED_SCHEME hack from setup.py.
Read more >
Kombu Documentation - Read the Docs
AMQP transport using the py-amqp, redis, or SQS_ libraries. ... the message with the routing key the consumer provides when binding to the ......
Read more >
amqplib | Channel API reference - GitHub Pages
Beware: attempting to unbind when there is no such binding may result in a punitive error (the AMQP specification says it's a connection-killing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found