django-celery-model icon indicating copy to clipboard operation
django-celery-model copied to clipboard

Type object 'ModelTaskMetaState' has no attribute 'REJECTED'

Open Moulde opened this issue 5 years ago • 0 comments

I have a weird issue after trying to reject a task. I am attempting to switch from redis to rabbitmq where the rejected / failed tasks should go to a specific queue where they can then be requeued manually if necessary.

But i get the following exception after trying to raise Reject(Exception("example"), requeue=False)

[2020-09-11 14:01:09,827: ERROR/ForkPoolWorker-1] Signal handler <function handle_task_postrun at 0x7f86adad2b50> raised: AttributeError("type object 'ModelTaskMetaState' has no attribute 'REJECTED'",)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/celery/utils/dispatch/signal.py", line 288, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/usr/local/lib/python2.7/site-packages/djcelery_model/models.py", line 234, in handle_task_postrun
    queryset.update(state=ModelTaskMetaState.lookup(state))
  File "/usr/local/lib/python2.7/site-packages/djcelery_model/models.py", line 33, in lookup
    return getattr(cls, state)
AttributeError: type object 'ModelTaskMetaState' has no attribute 'REJECTED'

Does anyone know what might be the issue? I am using the most recent version of celery 4.4.7

Does anyone have any ideas about why this causes an exception? It does seem like rejected is just not supported?

Best regards

Moulde avatar Sep 11 '20 14:09 Moulde