Archive renaming and "--archive latest" broken with Borg 2 #1146

Closed
opened 2025-09-15 02:05:20 +00:00 by witten · 2 comments
Owner

What I'm trying to do and why

When running borgmatic with Borg 2, several features related to archive names are broken. This is likely due to the way that Borg 2 peforms archive naming very different than Borg 1, such that multiple archives can (and with borgmatic, do) share the same name.

Steps to reproduce

$ borgmatic -c test.yaml -v 2 list --archive latest

And separately:

$ borgmatic create --config test.yaml -v 2 --list

Actual behavior

For the first command:

...
CommandError: Command Error: ['flux.checkpoint'] needed to match precisely one archive, but matched 2.
testrepo: Error running actions for repository
testrepo: Command '/root/borg2.0.0b19 list --debug --show-rc --repo test2.borg flux.checkpoint' returned non-zero exit status 4.
...

And for the second:

...
CommandError: Command Error: ['flux.checkpoint'] needed to match precisely one archive, but matched 2.
...
testrepo: Error running actions for repository
testrepo: Command '/root/borg2.0.0b19 rename --debug --show-rc --repo test2.borg flux.checkpoint flux' returned non-zero exit status 4.
/root/tmp/test.yaml: Error running configuration
/root/tmp/test.yaml: An error occurred
...

Actually, I lied. Before you can get to that error with create, you get this error first:

usage: borg2.0.0b19 [-V] [-h] [--critical] [--error] [--warning] [--info]
                    [--debug] [--debug-topic TOPIC] [-p] [--iec] [--log-json]
                    [--lock-wait SECONDS] [--show-version] [--show-rc]
                    [--umask M] [--remote-path PATH] [--upload-ratelimit RATE]
                    [--upload-buffer UPLOAD_BUFFER] [--debug-profile FILE]
                    [--rsh RSH] [--socket [PATH]] [-r REPO]
                    <command> ...
borg2.0.0b19: error: unrecognized arguments: --consider-checkpoints

Expected behavior

I would expect these commands to complete successfully without erroring on matching an archive name.

Other notes / implementation ideas

Maybe this isn't an "always" bug, but rather it's happening due to the fact that there are two identically named flux.checkpoint archives, possibly related to #1032 changes.

borgmatic version

2.0.8.dev0/main

borgmatic installation method

uv

Borg version

2.0.0b19

Python version

3.13.7

Database version (if applicable)

No response

Operating system and version

Manjaro stable

### What I'm trying to do and why When running borgmatic with Borg 2, several features related to archive names are broken. This is likely due to the way that Borg 2 peforms archive naming very different than Borg 1, such that multiple archives can (and with borgmatic, do) share the same name. ### Steps to reproduce ```bash $ borgmatic -c test.yaml -v 2 list --archive latest ``` And separately: ```bash $ borgmatic create --config test.yaml -v 2 --list ``` ### Actual behavior For the first command: ```bash ... CommandError: Command Error: ['flux.checkpoint'] needed to match precisely one archive, but matched 2. testrepo: Error running actions for repository testrepo: Command '/root/borg2.0.0b19 list --debug --show-rc --repo test2.borg flux.checkpoint' returned non-zero exit status 4. ... ``` And for the second: ```bash ... CommandError: Command Error: ['flux.checkpoint'] needed to match precisely one archive, but matched 2. ... testrepo: Error running actions for repository testrepo: Command '/root/borg2.0.0b19 rename --debug --show-rc --repo test2.borg flux.checkpoint flux' returned non-zero exit status 4. /root/tmp/test.yaml: Error running configuration /root/tmp/test.yaml: An error occurred ... ``` Actually, I lied. Before you can get to that error with `create`, you get this error first: ```bash usage: borg2.0.0b19 [-V] [-h] [--critical] [--error] [--warning] [--info] [--debug] [--debug-topic TOPIC] [-p] [--iec] [--log-json] [--lock-wait SECONDS] [--show-version] [--show-rc] [--umask M] [--remote-path PATH] [--upload-ratelimit RATE] [--upload-buffer UPLOAD_BUFFER] [--debug-profile FILE] [--rsh RSH] [--socket [PATH]] [-r REPO] <command> ... borg2.0.0b19: error: unrecognized arguments: --consider-checkpoints ``` ### Expected behavior I would expect these commands to complete successfully without erroring on matching an archive name. ### Other notes / implementation ideas Maybe this isn't an "always" bug, but rather it's happening due to the fact that there are two identically named `flux.checkpoint` archives, possibly related to #1032 changes. ### borgmatic version 2.0.8.dev0/main ### borgmatic installation method uv ### Borg version 2.0.0b19 ### Python version 3.13.7 ### Database version (if applicable) _No response_ ### Operating system and version Manjaro stable
Author
Owner

Implemented in main and will be part of the next release. The fix was to use archive ID instead of archive name with Borg 2 for these cases.

Implemented in main and will be part of the next release. The fix was to use archive ID instead of archive name with Borg 2 for these cases.
Author
Owner

Released in borgmatic 2.0.8!

Released in borgmatic 2.0.8!
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
borgmatic-collective/borgmatic#1146
No description provided.