celery/django-celery-results

Task name and positional arguments don't appear in the results

ddahan opened this issue ยท 24 comments

No matter how I run a task, I can't get the task name nor the parameters display in the results:

image

Here is my task (I tried with bind=True too):

@app.task(name="core.add")
def add(x, y):
    return x + y

To run the task, I tried:

  • In a shell: add.delay(2, 10)
  • In a shell: add.apply_async(args=[2, 10])
  • Using django-celery-beat, setting a new PeriodicTask object with position arguments set to [2, 10]

Same issue every time. What did I do wrong? Thanks.

image

me too

image

There is no problem with the replacement version 2.3.1

v2.4.0 released and v2.4.1 is coming

@AmitPhulera can you please verify the regression?

We are experiencing the same issues after upgrading to 2.4.0

We are experiencing the same issues after upgrading to 2.4.0

can you please check which commit created the regression? there is only two to check

is it ad508fe ?

After 2.4.0 upgrade (from 2.2.0), I see no tasks and no Periodic task name no positional arguments.
The upgrade was made in an attempt to solve a serious blocker with Oracle DB (DPI-1010 no connection) happening at random times. (I hope it is solved)

Thank you!

you can try 2.3.1

@auvipy It works as intended in e174c99 and in fact ad508fe seems to be the culprit.

@auvipy It works as intended in e174c99 and in fact ad508fe seems to be the culprit.

I am going to revert that

@auvipy I just tried setting CELERY_RESULT_EXTENDED = True and now everything is back to normal

I just read what ad508fe actually did - so my guess is that this is mostly a documentation issue?

Just read the conversation -
You got it correct @valberg, you have to set CELERY_RESULT_EXTENDED = True in order to save additional parameters. This is the default behavior of Celery and is described here.

I was looking for places where it could be documented but did not find anything. So I ended up adding it as a minor version bump and added some info there.

Guys, you saved my day with CELERY_RESULT_EXTENDED.
Now version 2.4.0 is workable!

However, PERIODIC_TASK_NAME is still empty, I'm running the task from beat.

Same thing, I don't have the task names anymore!
image

@felixmeziere set CELERY_RESULT_EXTENDED = True and it will work as before

hope put this in the document, remind all new comings.

Guys, you saved my day with CELERY_RESULT_EXTENDED. Now version 2.4.0 is workable!

However, PERIODIC_TASK_NAME is still empty, I'm running the task from beat.

Also having the same problem. Is there a fix?

This is still (?) broken in 2.5.1 even with CELERY_RESULT_EXTENDED = True

Seems like the setting only fixes it if your broker is redis, not rabbitmq.
#376
Are you using rabbitmq, @blakev and @Sureshlama23 ?

Seems like the setting only fixes it if your broker is redis, not rabbitmq. #376 Are you using rabbitmq @blakev

I'm using Redis 6/7 with Django 4.2, PostgreSQL 15/16

I had the same issue. I tried setting CELERY_RESULT_EXTENDED = True and everything is OK now.
Small tip: after setting this variable just rebuild (with --build parameter) all docker containers (redis, celery worker etc.) and rerun django app.