repository: clear error for borg 1.x repositories, fixes crash w/o --from-borg1 - #10418
Merged
ThomasWaldmann merged 1 commit intoSep 24, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #10418 +/- ##
=======================================
Coverage 88.38% 88.38%
=======================================
Files 103 103
Lines 19029 19039 +10
Branches 2961 2962 +1
=======================================
+ Hits 16819 16828 +9
- Misses 1538 1540 +2
+ Partials 672 671 -1 ☔ View full report in Codecov by Harness. |
ThomasWaldmann
force-pushed
the
legacy-repo-error
branch
from
September 24, 2026 15:06
b78f8d1 to
a5fd9ca
Compare
…from-borg1 Opening a borg 1.x repository without --from-borg1 crashed with a traceback while loading the config/config store object, because a borg 1.x repository has a config *file* where borg 2 has the config/ namespace (NotADirectoryError for a local repository, HTTP 500 via ssh://; InvalidRepository on Windows). borgstore 0.6.4 reports a name below an object as ObjectNotFound on all platforms, so require it. If config/config is not found, look at "config" via the store backend and raise Repository.LegacyRepository (rc 29) if it is a file, telling the user to use --from-borg1 (e.g. with borg transfer). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ThomasWaldmann
force-pushed
the
legacy-repo-error
branch
from
September 24, 2026 18:31
f7c4cba to
4164c09
Compare
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.
Description
Opening a borg 1.x repository with borg 2 without
--from-borg1crashed with a "Local Exception" traceback. Examples areborg -r /path/to/v1repo repo-info, orborg transfer --other-repo v1repowithout--from-borg1. A borg 1.x repository has aconfigfile where borg 2 expects theconfig/namespace, so loading theconfig/configstore object failed differently per platform and backend:NotADirectoryError: [Errno 20] Not a directory: '.../config/config'ssh://: the remoteborg serve --restanswered HTTP 500 ->requests.exceptions.HTTPErrorObjectNotFound/ HTTP 404), which borg reported asInvalidRepositoryborgstore 0.6.4 (borgbackup/borgstore#228) reports a name below an object as
ObjectNotFoundon all platforms. So this PR requiresborgstore ~= 0.6.4, and a borg 1.x repository now always ends up in theStoreObjectNotFoundbranch ofRepository._load_config. There, it looks atconfigvia the store backend (Store.infoonly takes names below a namespace). Ifconfigis a file, it raises the newRepository.LegacyRepositoryerror (rc 29):Otherwise it continues as before (a store without a repository config). If the probe itself fails with a backend or OS error, it's treated as "not a borg 1.x repository".
A remote
borg servethat still uses an older borgstore answers such a request with HTTP 500. In that case, the user still gets the traceback.Same symptom as the closed #9010 and #8652 (which involved older borg 2 betas).
Checklist
master(or maintenance branch if only applicable there)test_open_legacy_repository[file|ssh]inrepository_test.py;LegacyRepositoryadded to the error list indocs/internals/frontends.rst; borgstore requirement bumped inpyproject.tomlanddocs/installation.rsttoxor the relevant test subset): the test suite (except mount/FUSE) passes locally on macOS with borgstore 0.6.4🤖 Generated with Claude Code