Closed sbasu1303 closed 4 years ago
line 1096, in apply_converters value = converter(value, expression, connection) TypeError: from_db_value() missing 1 required positional argument: 'context' seem to be a django issue. can you try celery==4.4.6?
@auvipy Tried celery 4.4.6 getting same error.
Also forgot to mention in pip install -r requirements.txt I am getting an error:
ERROR: django-celery 3.3.1 has requirement celery<4.0,>=3.1.15, but you'll have celery 4.4.6 which is incompatible.
currently this is the only error:
[2020-06-24 19:30:06,966: WARNING/ForkPoolWorker-5] /usr/local/lib/python3.8/dist-packages/celery/app/trace.py:622: RuntimeWarning: Exception raised outside body: TypeError("from_db_value() missing 1 required positional argume
nt: 'context'"):
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/celery/app/trace.py", line 479, in trace_task
mark_as_done(
File "/usr/local/lib/python3.8/dist-packages/celery/backends/base.py", line 158, in mark_as_done
self.store_result(task_id, result, state, request=request)
File "/usr/local/lib/python3.8/dist-packages/celery/backends/base.py", line 442, in store_result
self._store_result(task_id, result, state, traceback,
File "/usr/local/lib/python3.8/dist-packages/djcelery/backends/database.py", line 31, in _store_result
self.TaskModel._default_manager.store_result(
File "/usr/local/lib/python3.8/dist-packages/djcelery/managers.py", line 47, in _inner
return fun(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/djcelery/managers.py", line 185, in store_result
return self.update_or_create(task_id=task_id,
File "/usr/local/lib/python3.8/dist-packages/djcelery/managers.py", line 92, in update_or_create
return get_queryset(self).update_or_create(**kwargs)
File "/usr/local/lib/python3.8/dist-packages/djcelery/managers.py", line 75, in update_or_create
obj, created = self.get_or_create(**kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 559, in get_or_create
return self.get(**kwargs), False
File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 411, in get
num = len(clone)
File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 258, in __len__
self._fetch_all()
File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 1261, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 74, in __iter__
for row in compiler.results_iter(results):
File "/usr/local/lib/python3.8/dist-packages/django/db/models/sql/compiler.py", line 1096, in apply_converters
value = converter(value, expression, connection)
TypeError: from_db_value() missing 1 required positional argument: 'context'
Is it like no async task from periodic_task?
you are using wrong package. try django-celery-beat and django-celery-results
I am getting the below error, any help appreciated. Pool callback raised exception: TypeError("from_db_value() missing 1 required positional argument: 'context'",) However my tasks are running, still why the error should come, please help me to correct my project configs.
celery.py:
settings.py
When the error is occurring? -If I and scheduling async task from a periodic task.
myTask.py
Python - 3.8.3 and 3.6.9(occurring for both) Django==3.0.2 celery==4.4.5 django-celery==3.3.1 django-celery-beat==2.0.0 kombu==4.6.10 billiard==3.6.3.0
Error:
[2020-06-24 09:44:08,589: ERROR/MainProcess] Pool callback raised exception: TypeError("from_db_value() missing 1 required positional argument: 'context'",) Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/billiard/pool.py", line 1796, in safe_apply_callback fun(*args, **kwargs) File "/usr/local/lib/python3.6/dist-packages/celery/worker/request.py", line 528, in on_failure store_result=self.store_errors, File "/usr/local/lib/python3.6/dist-packages/celery/backends/base.py", line 169, in mark_as_failure traceback=traceback, request=request) File "/usr/local/lib/python3.6/dist-packages/celery/backends/base.py", line 443, in store_result request=request, **kwargs) File "/usr/local/lib/python3.6/dist-packages/djcelery/backends/database.py", line 33, in _store_result traceback=traceback, children=self.current_task_children(request), File "/usr/local/lib/python3.6/dist-packages/djcelery/managers.py", line 47, in _inner return fun(*args, **kwargs) File "/usr/local/lib/python3.6/dist-packages/djcelery/managers.py", line 189, in store_result 'meta': {'children': children}}) File "/usr/local/lib/python3.6/dist-packages/djcelery/managers.py", line 92, in update_or_create return get_queryset(self).update_or_create(**kwargs) File "/usr/local/lib/python3.6/dist-packages/djcelery/managers.py", line 75, in update_or_create obj, created = self.get_or_create(**kwargs) File "/usr/local/lib/python3.6/dist-packages/django/db/models/query.py", line 559, in get_or_create return self.get(**kwargs), False File "/usr/local/lib/python3.6/dist-packages/django/db/models/query.py", line 411, in get num = len(clone) File "/usr/local/lib/python3.6/dist-packages/django/db/models/query.py", line 258, in __len__ self._fetch_all() File "/usr/local/lib/python3.6/dist-packages/django/db/models/query.py", line 1261, in _fetch_all self._result_cache = list(self._iterable_class(self)) File "/usr/local/lib/python3.6/dist-packages/django/db/models/query.py", line 74, in __iter__ for row in compiler.results_iter(results): File "/usr/local/lib/python3.6/dist-packages/django/db/models/sql/compiler.py", line 1096, in apply_converters value = converter(value, expression, connection) TypeError: from_db_value() missing 1 required positional argument: 'context'