Improve error message when mounting archive when multiple repositories are defined #566
Loading…
x
Reference in New Issue
Block a user
No description provided.
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
We're busy migrating our backups to a different storage backend. This means we now have two different repositories defined within the borgmatic configuration.
Backups have a timestamp in their archive name, and while similar, the name is of course different on both backup repositories. Now when we attempt to mount a backup that is present on our second repository borgmatic will try to mount it from our first defined repository first. This fails, of course, and prints out a big red error message.
After that, it tries mounting it from the second defined repository, and succeeds since the archive name is present there, but the success is silent. This leads to a red error message but in fact also having succeeded in mounting it from the other repo.
This behaviour is a bit confusing.
Steps to reproduce (if a bug)
So if you have defined 2 repositories in a borgmatic config and do a borgmatic list, you'd get something like this (filtered):
Now if we attempt to mount the secondary archive:
However, it mounted correctly from the second backup repository:
Other notes / implementation ideas
Perhaps when multiple repo's are present either give the error message at the end if all repo's failed to mount the supplied archive, or give an information message that:
Environment
borgmatic version: [1.6.6]
Use
sudo borgmatic --version
orsudo pip show borgmatic | grep ^Version
borgmatic installation method: [pip]
Borg version: [1.2.1]
Use
sudo borg --version
Python version: [3.9.2]
Use
python3 --version
operating system and version: [Debian 11]
Thanks for filing this! I totally agree that the existing behavior is confusing. What do you think of making the
--repository
flag required forborgmatic mount
if there are multiple repositories configured (or in general)? It doesn't really make sense to attempt to mount a named archive from multiple repositories onto a single mount point; one of them is going to fail.Requiring the repository flag when multiple mountpoints are defined seems fair to me as well, with a informational message that this flag is required when attempting to mount without supplying
--repository
.I personally wouldn't require it when just a single repository is defined; having it filled in automatically when there's only one possible choice to make seems more user friendly 👍
That makes sense, thanks!
This is implemented in master now, and will be part of the next release. Thanks again!
Thank you!
Just released in borgmatic 1.7.0!