<p dir="auto">sometimes celery with redis appear the problem:<br>
portal_page_handler.py:3175 ERROR   Traceback (most recent call last):<br>
File "/home/ixianxia/web_app_src/shanghu_wifi/handler/portal_page_handler.py", line 3123, in get<br>
self.cur_user.card_no)<br>
File "/home/ixianxia/local/python/lib/python2.7/site-packages/celery/app/task.py", line 452, in delay<br>
return self.apply_async(args, kwargs)<br>
File "/home/ixianxia/local/python/lib/python2.7/site-packages/celery/app/task.py", line 554, in apply_async<br>
*_dict(self._get_exec_options(), *_options)<br>
File "/home/ixianxia/local/python/lib/python2.7/site-packages/celery/app/base.py", line 321, in send_task<br>
reply_to=reply_to or self.oid, *_options<br>
File "/home/ixianxia/local/python/lib/python2.7/site-packages/celery/app/amqp.py", line 299, in publish_task<br>
*_kwargs<br>
File "/home/ixianxia/local/python/lib/python2.7/site-packages/kombu/messaging.py", line 166, in publish<br>
routing_key, mandatory, immediate, exchange, declare)<br>
File "/home/ixianxia/local/python/lib/python2.7/site-packages/kombu/connection.py", line 440, in _ensured<br>
return fun(_args, *_kwargs)<br>
File "/home/ixianxia/local/python/lib/python2.7/site-packages/kombu/messaging.py", line 182, in _publish<br>
mandatory=mandatory, immediate=immediate,<br>
File "/home/ixianxia/local/python/lib/python2.7/site-packages/kombu/transport/virtual/<strong>init</strong>.py", line 524, in basic_publish<br>
message, exchange, routing_key, **kwargs<br>
File "/home/ixianxia/local/python/lib/python2.7/site-packages/kombu/transport/virtual/exchange.py", line 60, in deliver<br>
for queue in _lookup(exchange, routing_key):<br>
File "/home/ixianxia/local/python/lib/python2.7/site-packages/kombu/transport/virtual/<strong>init</strong>.py", line 615, in _lookup<br>
self.get_table(exchange),<br>
File "/home/ixianxia/local/python/lib/python2.7/site-packages/kombu/transport/redis.py", line 693, in get_table<br>
raise InconsistencyError(NO_ROUTE_ERROR.format(exchange, key))<br>
InconsistencyError:<br>
Cannot route message for exchange 'default': Table empty or key no longer exists.<br>
Probably the key ('_kombu.binding.default') has been removed from the Redis database.</p>
<p dir="auto">I have installed Celery v3.0.19 with Redis as MQ backend. Everything was fine right after I set them up, but after a while Celery started throwing an error when <code class="notranslate">.delay</code> method was called to add a task to queue.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Cannot route message for exchange 'celery': Table empty or key no longer exists.
Probably the key ('_kombu.binding.celery') has been removed from the Redis database."><pre lang="InconsistencyError:" class="notranslate"><code class="notranslate">Cannot route message for exchange 'celery': Table empty or key no longer exists.
Probably the key ('_kombu.binding.celery') has been removed from the Redis database.
</code></pre></div>
<p dir="auto">There is no any googleable solution for this problem. But it seems I fixed it for me by specifying <code class="notranslate">timeout 0</code> in my <code class="notranslate">redis.conf</code> file. It had 300 set by default in version 2.2.12 that I installed from repo on 12.04.2 Ubuntu Server.</p>
<p dir="auto"><code class="notranslate">timeout n</code>, where n  &gt; 0 means the idle client will be disconnected after n seconds. Kombu's Redis transport may not be able to handle this kind of disconnection.</p>