[BUG] arguments and results is shown with empty/Null although I am sure they have values
Describe the bug
I have a configuration where redis is working as broker and results backend.
I can see the tasks when I trigger/clients but I always see the Arguments and results with Empty/None in the tasks view.
e.g. http://localhost:8555/tasks/
To Reproduce Steps to reproduce the behavior:
- Start a celery chain where the tasks has arguments and return vaules
- click from the tasks explorer on a task
- Scroll down to see Arguments and Results in the tasks view
- See that arguments is empty and results has None
Expected behavior Arguments / Kwargs will have values Results will have values
Screenshots If applicable, add screenshots to help explain your problem.
Additional context the result backend and the broker are both redis.
Hey, just to make sure - have you enabled result_extended=True in your Celery app?
https://docs.celeryq.dev/en/stable/userguide/configuration.html#result-extended
It is recommended here in the README.md, this potentially could be added to the UI as well.
https://github.com/danyi1212/celery-insights?tab=readme-ov-file#enabling-celery-events
yeah, I enabled result_extended Here is the configuration block ` app.conf.worker_send_task_events = True
app.conf.task_send_sent_event = True
app.conf.task_track_started = True
app.conf.result_extended = True `
Actually in the state.json, I can see the values correctly.
An example for the json output of state is something like : `
| 17 | |
|---|---|
| id | "1212ed51-b525-470c-9eba-f4a2453768ba" |
| type | "Create Order for Something" |
| state | "SUCCESS" |
| sent_at | 1728639287.4776063 |
| received_at | 1728639287.4232242 |
| started_at | 1728639287.4248035 |
| succeeded_at | 1728639287.4776063 |
| failed_at | null |
| retried_at | null |
| revoked_at | null |
| rejected_at | null |
| runtime | 0.052537856998242205 |
| last_updated | 1728639287.4776063 |
| args | "()" |
| kwargs | "{'order_id': UUID('ee6c13a4-4ad6-4a16-9756-665fe6baedcf')}" |
| eta | null |
| expires | null |
| retries | 0 |
| exchange | null |
| routing_key | null |
| root_id | "06648238-457d-41e9-9f18-89398ccd82f9" |
| parent_id | "f9d420f2-d21a-490f-94df-ea41851ba517" |
| children | |
| 0 | "581dd489-4dbe-4dd3-9ab6-5e140f0650ad" |
| worker | "celery_worker@114a8d7a90e8-1" |
| result | "UUID('fd6c114a-9120-44b3-a00a-22b8b05b127f')" |
| exception | null |
| traceback | null |
| ` |
Interesting, did you take that state.json from the Debug Bundle? Can you please share what is responded from the /api/tasks/{task_id}/result call in the task details from the browser's network tab?
yes, I did take the state.json out of the Debug Bundle.
The output of the /api/tasks/{task_id}/result is :
{ "id": "d8aaba40-38af-4661-9a56-64aaf8196f62", "type": null, "state": "PENDING", "queue": null, "result": null, "traceback": null, "ignored": false, "args": [], "kwargs": {}, "retries": 0, "worker": null }
Is there a way to solve this? I have the same issue - empty args
@pedrodevoto Not that I know of, I haven't got the time yet to fix that 😔
From my observation, the args are not returned from the Redis (or other Result Backend), but is available as string on the state, that you can observe in the DevTools network responses.
For more details - This endpoint have them as Pickle String (coming from Events) - https://github.com/danyi1212/celery-insights/blob/main/server/tasks/router.py#L22 This endpoint does have them (coming from Result Store) - https://github.com/danyi1212/celery-insights/blob/main/server/tasks/router.py#L34
If you can, your help in debugging it and contributing a fix will be appreciated a lot, I would love to guide you on doing that 🌟