celery -A proj report
in the issue.software -> celery:4.0.2 (latentcall) kombu:4.0.2 py:3.6.1
billiard:3.5.0.2 py-amqp:2.1.4
platform -> system:Darwin arch:64bit imp:CPython
loader -> celery.loaders.default.Loader
settings -> transport:amqp results:disabled
self.retry()
send_task
and set expires
The task should retry until the expires time is hit or the max_retries value is hit
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/celery/app/task.py", line 684, in retry
S.apply_async()
File "/usr/lib/python3.6/site-packages/celery/canvas.py", line 221, in apply_async
return _apply(args, kwargs, **options)
File "/usr/lib/python3.6/site-packages/celery/app/task.py", line 535, in apply_async
**options
File "/usr/lib/python3.6/site-packages/celery/app/base.py", line 729, in send_task
root_id, parent_id, shadow, chain,
File "/usr/lib/python3.6/site-packages/celery/app/amqp.py", line 334, in as_task_v2
expires = expires and expires.isoformat()
AttributeError: 'str' object has no attribute 'isoformat'
A workaround that appears to fix the issue - reassigning the value of self.request.expires
before raising self.retry()
.
I.e., in the run method:
self.request.expires = dateparser.parse(self.request.expires)
raise self.retry()
probably this is fixed and we can close it? @thedrow
Looks like a duplicate.
Please try the latest RC and see if the problem is resolved.
If it isn't, comment here and we'll reopen.
Most helpful comment
A workaround that appears to fix the issue - reassigning the value of
self.request.expires
before raisingself.retry()
.I.e., in the run method: