Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/+sync_repair_manifest_data.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add transparent repair code during Manifest sync to redownload the raw data in case it was lost during an upgrade.
10 changes: 9 additions & 1 deletion pulp_container/app/tasks/sync_stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,15 @@ async def _check_for_existing_manifest(self, download_tag):
digest=digest, pulp_domain=get_domain()
).afirst():
raw_text_data = manifest.data
content_data = json.loads(raw_text_data)
if raw_text_data is None:
# This situation allegedly happens on some upgrade paths.
# A migration should mark the field not Null eventually. At that point this
# workaround can be removed.
content_data, raw_text_data, _ = await self._download_manifest_data(response.url)
manifest.data = raw_text_data
await manifest.asave()
else:
content_data = json.loads(raw_text_data)
else:
content_data, raw_text_data, response = await self._download_manifest_data(response.url)

Expand Down
Loading