Skip to content

failed to run chord example from tutorial #1052

Closed

Description

@Abell1835

I'm running celery v3.0.11 with RabbitMQ and memcached as backend.

When i'm trying to run example from tutorial:


from celery import chord
from tasks import add, tsum
chord(add.subtask((i, i)) for i in xrange(100))(tsum.subtask()).get()

worker craches with the following errors:


[2012-10-31 14:43:35,344: DEBUG/MainProcess] consumer: Ready to accept tasks!
[2012-10-31 14:43:42,756: INFO/MainProcess] Got task from broker: task.add[6171d2ac-144a-4a91-a1a0-1c0cedf84539]
[2012-10-31 14:43:42,757: INFO/MainProcess] Got task from broker: task.add[fa994398-ca6f-4ead-a2ec-8dc6fa1856a4]
[2012-10-31 14:43:42,794: DEBUG/MainProcess] Mediator: Running callback for task: task.add[6171d2ac-144a-4a91-a1a0-1c0cedf84539]
[2012-10-31 14:43:42,794: DEBUG/MainProcess] TaskPool: Apply  (args:('task.add', '6171d2ac-144a-4a91-a1a0-1c0cedf84539', (0, 0), {}, {'utc': True, 'is_eager': False, 'chord': task.tsum(), 'group': '5a991eec-d4ad-4c17-9c2e-c5bcec37122e', 'args': (0, 0), 'retries': 0, 'delivery_info': {'priority': None, 'routing_key': u'celerytut', 'exchange': u'celerytut'}, 'expires': None, 'task': 'task.add', 'callbacks': None, 'errbacks': None, 'hostname': 'ht03', 'taskset': '5a991eec-d4ad-4c17-9c2e-c5bcec37122e', 'kwargs': {}, 'eta': None, 'id': '6171d2ac-144a-4a91-a1a0-1c0cedf84539'}) kwargs:{})
[2012-10-31 14:43:42,794: DEBUG/MainProcess] Mediator: Running callback for task: task.add[fa994398-ca6f-4ead-a2ec-8dc6fa1856a4]
[2012-10-31 14:43:42,795: DEBUG/MainProcess] TaskPool: Apply  (args:('task.add', 'fa994398-ca6f-4ead-a2ec-8dc6fa1856a4', (1, 1), {}, {'utc': True, 'is_eager': False, 'chord': task.tsum(), 'group': '5a991eec-d4ad-4c17-9c2e-c5bcec37122e', 'args': (1, 1), 'retries': 0, 'delivery_info': {'priority': None, 'routing_key': u'celerytut', 'exchange': u'celerytut'}, 'expires': None, 'task': 'task.add', 'callbacks': None, 'errbacks': None, 'hostname': 'ht03', 'taskset': '5a991eec-d4ad-4c17-9c2e-c5bcec37122e', 'kwargs': {}, 'eta': None, 'id': 'fa994398-ca6f-4ead-a2ec-8dc6fa1856a4'}) kwargs:{})
[2012-10-31 14:43:42,796: DEBUG/MainProcess] Task accepted: task.add[6171d2ac-144a-4a91-a1a0-1c0cedf84539] pid:12991
[2012-10-31 14:43:45,804: WARNING/PoolWorker-1] /usr/local/lib/python2.6/dist-packages/celery-3.0.11-py2.6.egg/celery/task/trace.py:328: RuntimeWarning: Exception raised outside body: TypeError("object of type 'NoneType' has no len()",):
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/celery-3.0.11-py2.6.egg/celery/task/trace.py", line 266, in trace_task
    on_chord_part_return(task)
  File "/usr/local/lib/python2.6/dist-packages/celery-3.0.11-py2.6.egg/celery/backends/base.py", line 475, in on_chord_part_return
    if val >= len(deps):
TypeError: object of type 'NoneType' has no len()

  exc, exc_info.traceback)))
[2012-10-31 14:43:45,805: CRITICAL/MainProcess] Task task.add[6171d2ac-144a-4a91-a1a0-1c0cedf84539] INTERNAL ERROR: TypeError("object of type 'NoneType' has no len()",)
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/celery-3.0.11-py2.6.egg/celery/task/trace.py", line 266, in trace_task
    on_chord_part_return(task)
  File "/usr/local/lib/python2.6/dist-packages/celery-3.0.11-py2.6.egg/celery/backends/base.py", line 475, in on_chord_part_return
    if val >= len(deps):
TypeError: object of type 'NoneType' has no len()
[2012-10-31 14:43:45,806: DEBUG/MainProcess] Task accepted: task.add[fa994398-ca6f-4ead-a2ec-8dc6fa1856a4] pid:12991
[2012-10-31 14:43:48,810: CRITICAL/MainProcess] Task task.add[fa994398-ca6f-4ead-a2ec-8dc6fa1856a4] INTERNAL ERROR: TypeError("object of type 'NoneType' has no len()",)
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/celery-3.0.11-py2.6.egg/celery/task/trace.py", line 266, in trace_task
    on_chord_part_return(task)
  File "/usr/local/lib/python2.6/dist-packages/celery-3.0.11-py2.6.egg/celery/backends/base.py", line 475, in on_chord_part_return
    if val >= len(deps):
TypeError: object of type 'NoneType' has no len()

Looks like

deps = GroupResult.restore(gid, backend=task.backend) 

returns None

Activity

  1. jberka commented on Nov 1, 2012

    @jberka

    I'm seeing this using celery v3.0.9 with a Redis backend as well.

  2. bpowers commented on Nov 29, 2012

    @bpowers
    Contributor

    it sounds like this is the same thing I reported/documented here: #1094

  3. ask commented on Mar 5, 2013

    @ask
    Contributor

    Thanks! Closed by 5b3eef5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions