celery / django-celery-results

Celery result back end with django
Other
684 stars 203 forks source link

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

Closed ddahan closed 2 years ago

ddahan commented 2 years ago

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:

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

cuiliang0302 commented 2 years ago

image

me too

cuiliang0302 commented 2 years ago

image

There is no problem with the replacement version 2.3.1

auvipy commented 2 years ago

v2.4.0 released and v2.4.1 is coming

auvipy commented 2 years ago

@AmitPhulera can you please verify the regression?

valberg commented 2 years ago

We are experiencing the same issues after upgrading to 2.4.0

auvipy commented 2 years ago

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

auvipy commented 2 years ago

is it https://github.com/celery/django-celery-results/commit/ad508fe3433499e5fc94645412d911e174863f28 ?

andreasgou commented 2 years ago

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!

auvipy commented 2 years ago

you can try 2.3.1

valberg commented 2 years ago

@auvipy It works as intended in e174c9978c66f7d9c753d9332e2ec66c8abe1c1a and in fact ad508fe3433499e5fc94645412d911e174863f28 seems to be the culprit.

auvipy commented 2 years ago

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

I am going to revert that

valberg commented 2 years ago

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

valberg commented 2 years ago

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

AmitPhulera commented 2 years ago

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.

andreasgou commented 2 years ago

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.

felixmeziere commented 2 years ago

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

image
valberg commented 2 years ago

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

licsber commented 1 year ago

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

suspiciousRaccoon commented 8 months ago

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?

blakev commented 7 months ago

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

Sureshlama23 commented 7 months ago

Getting blank PERIODIC_TASK_NAME & more, after setting CELERY_RESULT_EXTENDED = True. Celery 2.5.1

oatnog commented 6 months ago

Seems like the setting only fixes it if your broker is redis, not rabbitmq. https://github.com/celery/django-celery-results/issues/376 Are you using rabbitmq, @blakev and @Sureshlama23 ?

blakev commented 6 months ago

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

Sanchows commented 4 months ago

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.