borgmatic seems to be confused re --glob-archives and --match-archives #666
Reference in New Issue
Block a user
Delete Branch "%!s()"
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
-aargument.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/./NASEnvironment
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-archivesor--glob-archivesas 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.pyetc, 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_prefixto theexcludesargument 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
--archiveis 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-archivesflag 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-archivesoverride 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!