celery.chord gives IndexError: list index out of range error in celery version 3.0.19

Has anyone seen this error in celery (a distribute task worker in Python) before?

Traceback (most recent call last):
  File "/home/mcapp/.virtualenv/lister/local/lib/python2.7/site-packages/celery/task/trace.py", line 228, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/home/mcapp/.virtualenv/lister/local/lib/python2.7/site-packages/celery/task/trace.py", line 415, in __protected_call__
    return self.run(*args, **kwargs)
  File "/home/mcapp/lister/lister/tasks/__init__.py", line 69, in update_playlist_db
    video_update(videos)
  File "/home/mcapp/lister/lister/tasks/__init__.py", line 55, in video_update
    chord(tasks)(update_complete.s(update_id=update_id, update_type='db', complete=True))
  File "/home/mcapp/.virtualenv/lister/local/lib/python2.7/site-packages/celery/canvas.py", line 464, in __call__
    _chord = self.type
  File "/home/mcapp/.virtualenv/lister/local/lib/python2.7/site-packages/celery/canvas.py", line 461, in type
    return self._type or self.tasks[0].type.app.tasks['celery.chord']
IndexError: list index out of range

This particular version of celery is 3.0.19, and happens when the celery chord feature is used. We don't think there is any error in our application, as 99% of the time our code works correctly, but under heavier loads this error would happen. We are trying to find out if this is an actual bug in our application or a celery bug, any help would be greatly appreciated.

Upvotes: 2

Views: 1115

Answers (1)

Andrew Brown
Andrew Brown

Reputation: 73

This is an error that occurs when a chord header has no tasks in it. Celery tries to access the tasks in the header using self.tasks[0] which results in an index error since there are no tasks in the list.

Upvotes: 1

Related Questions