Issue #6045
Updated by osapryki almost 5 years ago
After a long time running pulp-content-app all requests begin failing with the following error message: ~~~ Traceback (most recent call last): File "/venv/lib64/python3.6/site-packages/aiohttp/web_protocol.py", line 418, in start resp = await task File "/venv/lib64/python3.6/site-packages/aiohttp/web_app.py", line 458, in _handle resp = await handler(request) File "/venv/lib64/python3.6/site-packages/pulpcore/content/handler.py", line 117, in stream_content return await self._match_and_stream(path, request) File "/venv/lib64/python3.6/site-packages/pulpcore/content/handler.py", line 309, in _match_and_stream distro = self._match_distribution(path) File "/venv/lib64/python3.6/site-packages/pulpcore/content/handler.py", line 158, in _match_distribution return BaseDistribution.objects.get(base_path__in=base_paths).cast() File "/venv/lib64/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/venv/lib64/python3.6/site-packages/django/db/models/query.py", line 402, in get num = len(clone) File "/venv/lib64/python3.6/site-packages/django/db/models/query.py", line 256, in __len__ self._fetch_all() File "/venv/lib64/python3.6/site-packages/django/db/models/query.py", line 1242, in _fetch_all self._result_cache = list(self._iterable_class(self)) File "/venv/lib64/python3.6/site-packages/django/db/models/query.py", line 55, in __iter__ results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size) File "/venv/lib64/python3.6/site-packages/django/db/models/sql/compiler.py", line 1131, in execute_sql cursor = self.connection.cursor() File "/venv/lib64/python3.6/site-packages/django/db/backends/base/base.py", line 256, in cursor return self._cursor() File "/venv/lib64/python3.6/site-packages/django/db/backends/base/base.py", line 235, in _cursor return self._prepare_cursor(self.create_cursor(name)) File "/venv/lib64/python3.6/site-packages/django/db/utils.py", line 89, in __exit__ raise dj_exc_value.with_traceback(traceback) from exc_value File "/venv/lib64/python3.6/site-packages/django/db/backends/base/base.py", line 235, in _cursor return self._prepare_cursor(self.create_cursor(name)) File "/venv/lib64/python3.6/site-packages/django/db/backends/postgresql/base.py", line 223, in create_cursor cursor = self.connection.cursor() django.db.utils.InterfaceError: connection already closed ~~~ Possible reason is that pulp-content-app doesn't re-establish database connection whenever it closes.