-
Notifications
You must be signed in to change notification settings - Fork 1
Description
I have not been able to identify why this is happening yet, but under Django v6.02, I have seen the taskworker die after a "long period" of time. For example, 24 hours or more, with the following error:
INFO 2026-03-09 10:17:21,065 Task id=019cd32c-95ba-76ca-84b0-69c5d2148c42 path=quickbbs.tasks.generate_missing_thumbnails state=SUCCESSFUL
NoneType: None
WARNING 2026-03-09 19:23:23,033 discarding closed connection: <psycopg.Connection [BAD] at 0x10c8f86e0>
Traceback (most recent call last):
File "/Users/benjamin/venvs/quickbbs-6VT4FMOD-py3.14/lib/python3.14/site-packages/django/db/backends/utils.py", line 105, in _execute
return self.cursor.execute(sql, params)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/Users/benjamin/venvs/quickbbs-6VT4FMOD-py3.14/lib/python3.14/site-packages/psycopg/cursor.py", line 117, in execute
raise ex.with_traceback(None)
psycopg.OperationalError: consuming input failed: could not receive data from server: Operation timed out
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Volumes/Support-8tb/Gallery/Quickbbs/quickbbs/manage.py", line 10, in
execute_from_command_line(sys.argv)
~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
File "/Users/benjamin/venvs/quickbbs-6VT4FMOD-py3.14/lib/python3.14/site-packages/django/core/management/init.py", line 443, in execute_from_command_line
utility.execute()
~~~~~~~~~~~~~~~^^
File "/Users/benjamin/venvs/quickbbs-6VT4FMOD-py3.14/lib/python3.14/site-packages/django/core/management/init.py", line 437, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/benjamin/venvs/quickbbs-6VT4FMOD-py3.14/lib/python3.14/site-packages/django/core/management/base.py", line 420, in run_from_argv
self.execute(*args, **cmd_options)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/Users/benjamin/venvs/quickbbs-6VT4FMOD-py3.14/lib/python3.14/site-packages/django/core/management/base.py", line 464, in execute
output = self.handle(*args, **options)
File "/Users/benjamin/venvs/quickbbs-6VT4FMOD-py3.14/lib/python3.14/site-packages/dbtasks/management/commands/taskrunner.py", line 59, in handle
).run()
~~~^^
File "/Users/benjamin/venvs/quickbbs-6VT4FMOD-py3.14/lib/python3.14/site-packages/dbtasks/runner.py", line 274, in run
self.delete_tasks()
~~~~~~~~~~~~~~~~~^^
File "/Users/benjamin/venvs/quickbbs-6VT4FMOD-py3.14/lib/python3.14/site-packages/dbtasks/runner.py", line 227, in delete_tasks
).delete()[0]
~~~~~~^^
File "/Users/benjamin/venvs/quickbbs-6VT4FMOD-py3.14/lib/python3.14/site-packages/django/db/models/query.py", line 1238, in delete
num_deleted, num_deleted_per_model = collector.delete()
~~~~~~~~~~~~~~~~^^
File "/Users/benjamin/venvs/quickbbs-6VT4FMOD-py3.14/lib/python3.14/site-packages/django/db/models/deletion.py", line 471, in delete
count = qs._raw_delete(using=self.using)
File "/Users/benjamin/venvs/quickbbs-6VT4FMOD-py3.14/lib/python3.14/site-packages/django/db/models/query.py", line 1260, in _raw_delete
return query.get_compiler(using).execute_sql(ROW_COUNT)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/benjamin/venvs/quickbbs-6VT4FMOD-py3.14/lib/python3.14/site-packages/django/db/models/sql/compiler.py", line 1624, in execute_sql
cursor.execute(sql, params)
~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/Users/benjamin/venvs/quickbbs-6VT4FMOD-py3.14/lib/python3.14/site-packages/django/db/backends/utils.py", line 79, in execute
return self._execute_with_wrappers(
~~~~~~~~~~~~~~~~~~~~~~~~~~~^
sql, params, many=False, executor=self._execute
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/Users/benjamin/venvs/quickbbs-6VT4FMOD-py3.14/lib/python3.14/site-packages/django/db/backends/utils.py", line 92, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/Users/benjamin/venvs/quickbbs-6VT4FMOD-py3.14/lib/python3.14/site-packages/django/db/backends/utils.py", line 100, in _execute
with self.db.wrap_database_errors:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/benjamin/venvs/quickbbs-6VT4FMOD-py3.14/lib/python3.14/site-packages/django/db/utils.py", line 94, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/Users/benjamin/venvs/quickbbs-6VT4FMOD-py3.14/lib/python3.14/site-packages/django/db/backends/utils.py", line 105, in _execute
return self.cursor.execute(sql, params)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/Users/benjamin/venvs/quickbbs-6VT4FMOD-py3.14/lib/python3.14/site-packages/psycopg/cursor.py", line 117, in execute
raise ex.with_traceback(None)
django.db.utils.OperationalError: consuming input failed: could not receive data from server: Operation timed out
Task worker has exited.
There is an error message from the taskworker indicating a BAD psycopg connection. So my first guess is that connection is closed by psycopg but the taskworker is assuming it's still good and times out.
Also, you might want to consider "tweaking" the name, it's very hard to find the repository in a google search due to name pollution between django-dbtasks & django-tasks-db. I don't have any advice on any sort of name tweak...