This bug was initially created as a copy of Bug #2062526 I am copying this bug because: RHUI 4.5.0 doesn't contain the updated version of python39-pulpcore (the fixed one is 3.21.6-1.el8pc.noarch.rpm but we still have 3.21.0-1.0.1.el8ui.noarch in 4.5.0) Description of problem: rhui-manager rhui (home) => s rhui (sync) => vr 7 - Error Red Hat Enterprise Linux 6 Server - Extended Life Cycle Support (RPMs) from RHUI (x86_64) deadlock detected DETAIL: Process 158239 waits for ShareLock on transaction 26190837; blocked by process 158203. Process 158203 waits for ShareLock on transaction 26191981; blocked by process 158239. HINT: See server log for query details. CONTEXT: while locking tuple (3768,56) in relation "core_contentartifact" Traceback: File "/usr/lib/python3.9/site-packages/pulpcore/tasking/pulpcore_worker.py", line 452, in _perform_task result = func(*args, **kwargs) File "/usr/lib/python3.9/site-packages/pulp_rpm/app/tasks/synchronizing.py", line 559, in synchronize repo_version = dv.create() or repo.latest_version() File "/usr/lib/python3.9/site-packages/pulpcore/plugin/stages/declarative_version.py", line 161, in create loop.run_until_complete(pipeline) File "/usr/lib64/python3.9/asyncio/base_events.py", line 647, in run_until_complete return future.result() File "/usr/lib/python3.9/site-packages/pulpcore/plugin/stages/api.py", line 225, in create_pipeline await asyncio.gather(*futures) File "/usr/lib/python3.9/site-packages/pulpcore/plugin/stages/api.py", line 43, in __call__ await self.run() File "/usr/lib/python3.9/site-packages/pulpcore/plugin/stages/content_stages.py", line 197, in run await sync_to_async(process_batch)() File "/usr/lib/python3.9/site-packages/asgiref/sync.py", line 435, in __call__ ret = await asyncio.wait_for(future, timeout=None) File "/usr/lib64/python3.9/asyncio/tasks.py", line 442, in wait_for return await fut File "/usr/lib64/python3.9/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/usr/lib/python3.9/site-packages/asgiref/sync.py", line 476, in thread_handler return func(*args, **kwargs) File "/usr/lib/python3.9/site-packages/pulpcore/plugin/stages/content_stages.py", line 186, in process_batch len(subq.values_list()) File "/usr/lib/python3.9/site-packages/django/db/models/query.py", line 262, in __len__ self._fetch_all() File "/usr/lib/python3.9/site-packages/django/db/models/query.py", line 1324, in _fetch_all self._result_cache = list(self._iterable_class(self)) File "/usr/lib/python3.9/site-packages/django/db/models/query.py", line 140, in __iter__ return compiler.results_iter(tuple_expected=True, chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size) File "/usr/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1130, in results_iter results = self.execute_sql(MULTI, chunked_fetch=chunked_fetch, chunk_size=chunk_size) File "/usr/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql cursor.execute(sql, params) File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 66, in execute return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers return executor(sql, params, many, context) File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/usr/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__ raise dj_exc_value.with_traceback(traceback) from exc_value File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params)