Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ddahan opened this issue Jun 30, 2022 · 23 comments
Closed

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

ddahan opened this issue Jun 30, 2022 · 23 comments

Comments

@ddahan
Copy link

ddahan commented Jun 30, 2022

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.

@cuiliang0302
Copy link

image

me too

@cuiliang0302
Copy link

image

There is no problem with the replacement version 2.3.1

@auvipy
Copy link
Member

auvipy commented Jul 1, 2022

v2.4.0 released and v2.4.1 is coming

@auvipy auvipy closed this as completed Jul 1, 2022
@auvipy auvipy reopened this Jul 1, 2022
@auvipy
Copy link
Member

auvipy commented Jul 1, 2022

@AmitPhulera can you please verify the regression?

jmsmkn added a commit to comic/grand-challenge.org that referenced this issue Jul 5, 2022
@valberg
Copy link
Contributor

valberg commented Jul 6, 2022

We are experiencing the same issues after upgrading to 2.4.0

@auvipy
Copy link
Member

auvipy commented Jul 6, 2022

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
Copy link
Member

auvipy commented Jul 6, 2022

is it ad508fe ?

@andreasgou
Copy link

andreasgou commented Jul 7, 2022

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
Copy link
Member

auvipy commented Jul 7, 2022

you can try 2.3.1

@valberg
Copy link
Contributor

valberg commented Jul 7, 2022

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

@auvipy
Copy link
Member

auvipy commented Jul 7, 2022

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

I am going to revert that

@valberg
Copy link
Contributor

valberg commented Jul 7, 2022

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

@valberg
Copy link
Contributor

valberg commented Jul 7, 2022

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

@AmitPhulera
Copy link
Contributor

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
Copy link

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
Copy link

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

@valberg
Copy link
Contributor

valberg commented Jul 12, 2022

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

iloveagent57 added a commit to openedx/enterprise-catalog that referenced this issue Aug 8, 2022
... so task results persist the name and args of the task.
celery/django-celery-results#326
vanbuiten added a commit to Amsterdam/signals that referenced this issue Oct 26, 2022
add the missing information to the database. This is a known issue in release
2.4.0 see celery/django-celery-results#326
@licsber
Copy link

licsber commented Jun 6, 2023

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

RomainFayolle added a commit to FJNR-inc/Blitz-API that referenced this issue Jan 9, 2024
@suspiciousRaccoon
Copy link

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
Copy link

blakev commented Feb 22, 2024

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

@Sureshlama23
Copy link

Sureshlama23 commented Mar 4, 2024

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

@oatnog
Copy link

oatnog commented Mar 19, 2024

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

@blakev
Copy link

blakev commented Mar 19, 2024

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
Copy link

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.

irfanuddinahmad pushed a commit to openedx/enterprise-catalog that referenced this issue Jul 24, 2024
... so task results persist the name and args of the task.
celery/django-celery-results#326
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests