borgmatic seems to be confused re --glob-archives and --match-archives #666
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#666
Loadingโฆ
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
Trying to run borgmatic info with the
-a
argument.Steps to reproduce (if a bug)
Run
borgmatic -v2 -c /etc/borgmatic/config.yaml info -a '*a*'
Actual behavior (if a bug)
As you can see, I'm using borg 1, but the newer --match-archives is being supplied.
Expected behavior (if a bug)
Normal listing.
Other notes / implementation ideas
When run in an identical PyCharm environment, the feature args get even weirder:
borg info --debug --show-rc --glob-archives {hostname}-nas-* --match-archives '*a*' ssh://host/./NAS
Environment
borgmatic version: 1.7.9 and 1.7.11
borgmatic installation method: Python venv
Borg version: 1.2.2
Python version: 3.9.2
Database version (if applicable): [version here]
operating system and version: Debian 11
Thank you so much for reporting this! I've confirmed the behavior with Borg 1.2. I'm not quite sure what's going on yet, because the code is supposed to check the local Borg version and use
--match-archives
or--glob-archives
as appropriate. I'll dig into this and let you know what I find.Yep, agreed... I did see the cool stuff being done in
borg/feature.py
etc, and even ran tests viatox
-- even made another test as below and it strangely passed!I Was able to debug this:
The problem is with this line in
info.py::display_archives_info()
(line55):When I added
match_prefix
to theexcludes
argument formake_flags_from_arguments
, the error did not occur anymore.Aha! Nice catch. I'll make that fix and see if there's a way to catch this sort of issue in an integration test.
Not being fully immersed in the code, would this fix not need to be in other lines too, wherever
--archive
is accepted?Yes, this is likely a bug in multiple different actions. And what's worse, it looks like even once fixed, the
-a
/--match-archives
/--glob-archives
flag on the command-line isn't correctly overriding any of the other places that value can come from. Fortunately the fix should be pretty straightforward.This has been fixed in master for all relevant actions. I also fixed the related
--match-archives
override problem mentioned above. Lastly, I added a few integration tests that lightly "fuzz" some of the the functions that produce Borg arguments to hopefully catch related issues in the future.These fixes will be part of the next release. Thanks again for taking the time to file this. And thanks to @diivi for diagnosing!
You're awesome Dan, always a pleasure dealing with you :)
This fix has been released as part of borgmatic 1.7.12!