repo-list, compact: handle archives with a missing metadata object, fixes #10435 - #10437
Merged
ThomasWaldmann merged 1 commit intoSep 26, 2026
Conversation
…ixes borgbackup#10435 If an archive's metadata object is missing or invalid while its archives/ entry still exists, Archives.list() yields a placeholder ArchiveInfo for it, but opening it as an Archive raises Archive.DoesNotExist. - ArchiveFormatter: use the placeholder values of the ArchiveInfo (and defaults) if the archive can not be opened, so repo-list (and prune --list) go on. - compact: skip such a soft-deleted archive with the "cannot be fully preserved" warning, as documented in mark_soft_deleted_used(), instead of aborting. - Archive.DoesNotExist: show a binary archive id as hex. - check --format: keep using the fallback format for such archives. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #10437 +/- ##
==========================================
- Coverage 88.65% 88.62% -0.03%
==========================================
Files 103 103
Lines 19217 19229 +12
Branches 2993 2994 +1
==========================================
+ Hits 17036 17041 +5
- Misses 1513 1522 +9
+ Partials 668 666 -2 ☔ View full report in Codecov by Harness. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If an archive's metadata object is missing or invalid while its
archives/entry still exists,Archives.list()yields a placeholderArchiveInfofor it (namearchive-does-not-exist/archive-metadata-has-integrity-error), but opening it as anArchiveraisedArchive.DoesNotExist, aborting several commands with rc 31.ArchiveFormatter: if the archive can not be opened, use the placeholder values of theArchiveInfoand defaults for comment/tags/username/hostname/etc., soborg repo-list(also--deleted,--json) andborg prune --listcontinue.borg compact: skip such a soft-deleted archive with the "cannot be fully preserved" warning (as documented inmark_soft_deleted_used()) and go on compacting.Archive.DoesNotExist: show a binary archive id as hex instead of raw bytes.borg check --format: keep using the name/timestamp/hex-id fallback for such archives (it relied on the formatter raising).Regression tests added for repo-list and compact; they fail without the fix.
Fixes #10435.
🤖 Generated with Claude Code