Repository navigation
check: treat v2 archive metadata without item_ptrs as broken, refs #8649 - #10523
Open
ThomasWaldmann wants to merge 1 commit into
Open
ThomasWaldmann wants to merge 1 commit into
ThomasWaldmann wants to merge 1 commit into
Conversation
…rgbackup#8649 Authenticated archive metadata that lacks item_ptrs (or also has the v1 items key) crashed borg check with an AttributeError. Report it like other broken archive metadata and delete the archive with --repair. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10523 +/- ##
==========================================
+ Coverage 89.32% 89.34% +0.01%
==========================================
Files 104 104
Lines 20079 20088 +9
Branches 3152 3154 +2
==========================================
+ Hits 17936 17947 +11
+ Misses 1484 1481 -3
- Partials 659 660 +1 ☔ View full report in Codecov by Harness. |
This branch has not been deployed
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.
Authenticated v2 archive metadata that lacks
item_ptrscrashedborg checkwithAttributeError: attribute item_ptrs not found, because the archive loop only verifiedarchive.versionbefore readingarchive.item_ptrs.check now treats v2 archive metadata without
item_ptrs, or with the v1itemskey as well, like other broken archive metadata (missing or integrity error):--repair: logsArchive metadata block <id> is invalid: needs item_ptrs and no itemsplusWould delete broken archive ..., flags an error and continues with the next archive.--repair: deletes the archive, consistent with the existing handling of unusable archive metadata.Rejecting the "both keys" case is consistent with the "exactly one of item_ptrs, items" check that #10522 adds to
Archive._load_meta/Archives._parse_archive_meta; otherwisecheck --repairwould rebuild such an archive with the staleitemskey kept.Test:
test_archive_metadata_invalid_item_ptrsincheck_cmd_test.py(variants: noitem_ptrs, both keys) fails on master and passes with the fix.🤖 Generated with Claude Code