Checklist
Mandatory Debugging Information
Optional Debugging Information
Related Issues and Possible Duplicates
Related Issues
I use mongo broker and mongo backend.
There is a decoding error while try to get task result with AsyncResult
File "task_result.py", line 9, in <module> print(res.result) ...... \python37-32\Lib\json\__init__.py", line 341, in loads raise TypeError(f'the JSON object must be str, bytes or bytearray, ' kombu.exceptions.DecodeError: the JSON object must be str, bytes or bytearray, not dict
tasks.py
> @celery.task(name='web.add', bind=True)
> def add_test(self, x):
> time.sleep(6)
> message = 'IN WORKER'
> self.update_state(state='PROGRESS', meta={ 'current': 50, 'total': 100, 'status': message})
> time.sleep(10)
> message = 'END'
> return { 'current': 100, 'total': 100, 'status': message, 'result': { 'video_url': 42, 'video_player_url' : 'https://invidza.com' } }
task_result.py
>res = add.AsyncResult('d6605146-9296-463f-9463-9795d6b87f37')
>print(res)
>print(res.result)
Possible Duplicates
Environment & Settings
Celery version:
celery report Output:
Steps to Reproduce
Required Dependencies
- Minimal Python Version: N/A or Unknown
- Minimal Celery Version: N/A or Unknown
- Minimal Kombu Version: N/A or Unknown
- Minimal Broker Version: N/A or Unknown
- Minimal Result Backend Version: N/A or Unknown
- Minimal OS and/or Kernel Version: N/A or Unknown
- Minimal Broker Client Version: N/A or Unknown
- Minimal Result Backend Client Version: N/A or Unknown
Python Packages
pip freeze Output:
Other Dependencies
Details
N/A
Minimally Reproducible Test Case
Details
Expected Behavior
result = {'current': 50, 'total': 100, 'status': 'IN WORKER'}
Actual Behavior
Checklist
masterbranch of Celery.contribution guide
on reporting bugs.
for similar or identical bug reports.
for existing proposed fixes.
to find out if the bug was already fixed in the master branch.
in this issue (If there are none, check this box anyway).
Mandatory Debugging Information
celery -A proj reportin the issue.(if you are not able to do this, then at least specify the Celery
version affected).
masterbranch of Celery.pip freezein the issue.to reproduce this bug.
Optional Debugging Information
and/or implementation.
result backend.
broker and/or result backend.
ETA/Countdown & rate limits disabled.
and/or upgrading Celery and its dependencies.
Related Issues and Possible Duplicates
Related Issues
I use mongo broker and mongo backend.
There is a decoding error while try to get task result with AsyncResult
File "task_result.py", line 9, in <module> print(res.result) ...... \python37-32\Lib\json\__init__.py", line 341, in loads raise TypeError(f'the JSON object must be str, bytes or bytearray, ' kombu.exceptions.DecodeError: the JSON object must be str, bytes or bytearray, not dicttasks.py
task_result.py
Possible Duplicates
Environment & Settings
Celery version:
celery reportOutput:Steps to Reproduce
Required Dependencies
Python Packages
pip freezeOutput:Other Dependencies
Details
N/A
Minimally Reproducible Test Case
Details
Expected Behavior
result = {'current': 50, 'total': 100, 'status': 'IN WORKER'}
Actual Behavior