Currently we have a Python Django application hosted in Heroku cloud that uses Celery workers for background processing.
Celery workers were using django DB as the broker. Recently we decided to use IronMq as the broker since it’s an enterprise solution.
The packages we are using are
Python 2.7
Django 1.3
Celery 3.0.16
Django-celery 3.0.11
Iron-celery 0.3.1
We are using two workers. One worker is for the queue ‘Normal priority’ and another worker is for the queue HighPriority’. But when the application tired to start the worker for ‘HighPriority’ queue an error was triggered and as a result both the workers where crashed.
Following are additional settings we are using to configure IronMQ and celery queues.
BROKER_URL='ironmq://xxxxx:xxxxx@'
CELERY_RESULT_BACKEND='ironcache://xxxxx:xxxxx@'
import os
import djcelery
import iron_celery
from kombu import Exchange, Queue
djcelery.setup_loader()
CELERY_DEFAULT_QUEUE = 'NormalPriority'
CELERY_QUEUES = {
CELERY_DEFAULT_QUEUE: {
'exchange': CELERY_DEFAULT_QUEUE,
'binding_key': CELERY_DEFAULT_QUEUE,
}
}
CELERY_CREATE_MISSING_QUEUES=True
CELERY_ROUTES = {'tasks.retrieveDocketUsingWorker': {'queue': 'HighPriority'},
'tasks.retrieveDocketFromDdUsingWorker': {'queue': 'HighPriority'}
}
I have added a small part of the error log below. Some one please have a look into this.
2013-03-14T09:21:17+00:00 app[celeryd1.1]: self.queue_declare(nowait, passiv
e=False)
2013-03-14T09:21:17+00:00 app[celeryd1.1]: File "/app/.heroku/python/lib/pytho
n2.7/site-packages/kombu/entity.py", line 497, in queue_declare
2013-03-14T09:21:17+00:00 app[celeryd1.1]: nowait=nowait)
2013-03-14T09:21:17+00:00 app[celeryd1.1]: File "/app/.heroku/python/lib/pytho
n2.7/site-packages/kombu/transport/virtual/__init__.py", line 401, in queue_decl
are
2013-03-14T09:21:17+00:00 app[celeryd1.1]: return queue, self._size(queue),
0
2013-03-14T09:21:17+00:00 app[celeryd1.1]: File "/app/.heroku/python/lib/pytho
n2.7/site-packages/iron_celery/iron_mq_transport.py", line 78, in _size
2013-03-14T09:21:17+00:00 app[celeryd1.1]: return details["size"]
2013-03-14T09:21:17+00:00 app[celeryd1.1]: **TypeError: string indices must be int
egers**
2013-03-14T09:21:17+00:00 app[celeryd1.1]: [2013-03-14 05:21:17,631: INFO/MainPr
ocess] Celerybeat: Shutting down...
2013-03-14T09:21:18+00:00 heroku[celeryd1.1]: Process exited with status 0
2013-03-14T09:21:18+00:00 heroku[celeryd1.1]: State changed from up to crashed
2013-03-14T09:21:23+00:00 heroku[router]: at=info method=POST path=/getDocketDow
nloaderWorkerStatus/ host=www.irelanddev.com fwd="115.119.213.182" dyno=web.1 qu
eue=0 wait=0ms connect=1ms service=2447ms status=200 bytes=60
2013-03-14T09:21:26+00:00 heroku[router]: at=info method=POST path=/getDocketDow
nloaderWorkerStatus/ host=www.irelanddev.com fwd="115.119.213.182" dyno=web.1 qu
eue=0 wait=0ms connect=1ms service=23ms status=200 bytes=60
2013-03-14T09:21:31+00:00 heroku[router]: at=info method=POST path=/getDocketDow
nloaderWorkerStatus/ host=www.irelanddev.com fwd="115.119.213.182" dyno=web.1 qu
eue=0 wait=0ms connect=1ms service=196ms status=200 bytes=60
2013-03-14T09:21:36+00:00 heroku[router]: at=info method=POST path=/getDocketDow
Thanks in advance.