Marc
Marc

Reputation: 1360

Celery error: kombu.exceptions.NotBoundError: Can't call method on Exchange not bound to a channel

I'm using celery 4.0.2 with rabbitmq 3.6.6 and Django 1.10, here is my configuration:

from django.conf import settings

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'my_app.settings')

app = Celery('my_app')

app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)

app.conf.BROKER_URL = 'amqp://{}:{}@{}'.format(settings.AMQP_USER,  settings.AMQP_PASSWORD, settings.AMQP_HOST)
app.conf.CELERY_DEFAULT_EXCHANGE = 'my_app.celery'
app.conf.CELERY_DEFAULT_QUEUE = 'my_app.celery_default'
app.conf.CELERY_TASK_SERIALIZER = 'json'
app.conf.CELERY_ACCEPT_CONTENT = ['json']
app.conf.CELERY_IGNORE_RESULT = True
app.conf.CELERY_DISABLE_RATE_LIMITS = True
app.conf.BROKER_POOL_LIMIT = 2

app.conf.CELERY_QUEUES = (
    Queue(settings.QUEUE_1),
    Queue(settings.QUEUE_2),
    Queue(settings.QUEUE_3),
)

It works fine, but when I try to add a new queue, ie

app.conf.CELERY_QUEUES = (
    Queue(settings.QUEUE_1),
    Queue(settings.QUEUE_2),
    Queue(settings.QUEUE_3),
    Queue(settings.QUEUE_4),
)

I get this error:

kombu.exceptions.NotBoundError: Can't call method on Exchange not bound to a channel

If I remove one of these queues, it works again, so it seems to be limited to 3 queues. I don't understand why. Celery is launched like this:

celery worker -A my_app.celery_app

Any idea? Thanks in advance!

Upvotes: 1

Views: 1367

Answers (1)

Marc
Marc

Reputation: 1360

Ok this is probably because I'm using Python 3.6, see: https://github.com/celery/kombu/issues/675

Upvotes: 1

Related Questions