Question

i upgraded my celery from 2.4.X to celery-2.5.2, then modified the Broker_URL to be

BROKER_TRANSPORT = "sqlalchemy"
BROKER_URL = "sqla+mysql://root:root@localhost:3306/db"

this config can be referred via the page of http://docs.celeryproject.org/en/latest/getting-started/brokers/sqlalchemy.html#broker-sqlalchemy

the Celery process can be started successfully, but whan i call .delay or apply_async the process will throw out exception KeyError: 'No such transport: mysql' i have no idea about this.. looks like everything should be right.


Traceback

Traceback (most recent call last):

File "<console>", line 1, in <module>
File "C:\Python27\lib\site-packages\celery-2.5.2-py2.7.egg\celery\app\task\__init__.py", line 353, in delay
   return self.apply_async(args, kwargs)
File "C:\Python27\lib\site-packages\celery-2.5.2-py2.7.egg\celery\app\task\__init__.py", line 449, in apply_async
   publish = publisher or self.app.amqp.publisher_pool.acquire(block=True)
File "C:\Python27\lib\site-packages\kombu-2.1.5-py2.7.egg\kombu\connection.py", line 625, in acquire
   R = self.prepare(R)
File "C:\Python27\lib\site-packages\kombu-2.1.5-py2.7.egg\kombu\pools.py", line 55, in prepare
   p = p()
File "C:\Python27\lib\site-packages\kombu-2.1.5-py2.7.egg\kombu\pools.py", line 46, in <lambda>
   return lambda: self.create_producer()
File "C:\Python27\lib\site-packages\celery-2.5.2-py2.7.egg\celery\app\amqp.py", line 265, in create_producer
   pub = self.app.amqp.TaskPublisher(conn, auto_declare=False)
File "C:\Python27\lib\site-packages\celery-2.5.2-py2.7.egg\celery\app\amqp.py", line 328, in TaskPublisher
   return TaskPublisher(*args, **self.app.merge(defaults, kwargs))
File "C:\Python27\lib\site-packages\celery-2.5.2-py2.7.egg\celery\app\amqp.py", line 158, in __init__
   super(TaskPublisher, self).__init__(*args, **kwargs)
File "C:\Python27\lib\site-packages\kombu-2.1.5-py2.7.egg\kombu\compat.py", line 61, in __init__
   super(Publisher, self).__init__(connection, self.exchange, **kwargs)
File "C:\Python27\lib\site-packages\kombu-2.1.5-py2.7.egg\kombu\messaging.py", line 69, in __init__
   channel = channel.default_channel
File "C:\Python27\lib\site-packages\kombu-2.1.5-py2.7.egg\kombu\connection.py", line 556, in default_channel
   self.connection
File "C:\Python27\lib\site-packages\kombu-2.1.5-py2.7.egg\kombu\connection.py", line 549, in connection
self._connection = self._establish_connection()
File "C:\Python27\lib\site-packages\kombu-2.1.5-py2.7.egg\kombu\connection.py", line 509, in _establish_connection
   conn = self.transport.establish_connection()
File "C:\Python27\lib\site-packages\kombu-2.1.5-py2.7.egg\kombu\connection.py", line 569, in transport
   self._transport = self.create_transport()
File "C:\Python27\lib\site-packages\kombu-2.1.5-py2.7.egg\kombu\connection.py", line 324, in create_transport
   return self.get_transport_cls()(client=self)
File "C:\Python27\lib\site-packages\kombu-2.1.5-py2.7.egg\kombu\connection.py", line 331, in get_transport_cls
   transport_cls = get_transport_cls(transport_cls)
File "C:\Python27\lib\site-packages\kombu-2.1.5-py2.7.egg\kombu\transport__init__.py", line 94, in get_transport_cls
   _transport_cache[transport] = _get_transport_cls(transport)
File "C:\Python27\lib\site-packages\kombu-2.1.5-py2.7.egg\kombu\transport\__init__.py", line 75, in _get_transport_cls
   transport_module_name, transport_cls_name = resolve_transport(transport)
File "C:\Python27\lib\site-packages\kombu-2.1.5-py2.7.egg\kombu\transport\__init__.py", line 70, in resolve_transport
   raise KeyError("No such transport: %s" % (transport, ))
KeyError: 'No such transport: mysql'
Was it helpful?

Solution

After some debugging I've tracked this down to the version of kombu being installed. Kombu 2.1.5 was released on April 13th and does not appear to be compatible. I was able to resolve this issue by explicitly degrading to version 2.1.3.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top