Error: class uri 'gunicorn.workers.gthread.ThreadWorker' invalid or not found:
[Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/gthread.py", line 40, in <module>
from asyncio import selectors
ImportError: cannot import name 'selectors' from 'asyncio' (/usr/local/lib/python3.10/asyncio/__init__.py)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/gunicorn/util.py", line 135, in load_class
mod = import_module('.'.join(components))
File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/gthread.py", line 42, in <module>
from gunicorn import selectors
File "/usr/local/lib/python3.10/site-packages/gunicorn/selectors.py", line 11, in <module>
from collections import namedtuple, Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/local/lib/python3.10/collections/__init__.py)
]
Could not find any reason why gunicorn where frozen to 19 and could not find any applicable breaking changes inn the gunicorn changelog so upped it to 21.
pyproject.toml
has freezed Gunicorn tov19.9.*
, and that makes Devilry incompatible withdjango-storages
for S3 (includesboto3
) when running Python 3.10+:Another possible related issue caused by this is that custom logging for Gunicorn doesn't work for the request time in milliseconds (
%(M)s
).