From c139f674f62fcc215c84212ff226631cf9746c68 Mon Sep 17 00:00:00 2001 From: Ina Panova Date: Wed, 17 Aug 2022 21:56:19 +0200 Subject: [PATCH] Fixed an HTTP 404 response during sync from registry.redhat.io. Whenever a token expires a new token is requested. The 404 sync problem was triggered because the accept headers that were passed originally with the expired token were not passed to the re-newed token. As a result the registry was redirecting to the wrong schema version (schema1, which is unsupported since july 2022 https://access.redhat.com/articles/6138332) because of absense of the accept headers. closes #974 (cherry picked from commit 16e104ff0b2bf1ca86003a875b13bf1bbdc1c792) --- CHANGES/974.bugfix | 1 + pulp_container/app/downloaders.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 CHANGES/974.bugfix diff --git a/CHANGES/974.bugfix b/CHANGES/974.bugfix new file mode 100644 index 000000000..2bfd9bedb --- /dev/null +++ b/CHANGES/974.bugfix @@ -0,0 +1 @@ +Fixed an HTTP 404 response during sync from registry.redhat.io. diff --git a/pulp_container/app/downloaders.py b/pulp_container/app/downloaders.py index b3b4b988d..228cb0ee2 100644 --- a/pulp_container/app/downloaders.py +++ b/pulp_container/app/downloaders.py @@ -78,12 +78,12 @@ async def _run(self, handle_401=True, extra_data=None): self.registry_auth["bearer"] = None await self.update_token(response_auth_header, this_token, repo_name) - return await self._run(handle_401=False) + return await self._run(handle_401=False, extra_data=extra_data) elif "Basic" in response_auth_header: if self.remote.username: basic = aiohttp.BasicAuth(self.remote.username, self.remote.password) self.registry_auth["basic"] = basic.encode() - return await self._run(handle_401=False) + return await self._run(handle_401=False, extra_data=extra_data) else: raise to_return = await self._handle_response(response)