Fail when a configuration file is a symlink with a relative path #1292
Labels
No labels
blocked
breaking
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
borgmatic-collective/borgmatic#1292
Loading…
Add table
Add a link
Reference in a new issue
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
Hi,
Since a few weeks, my borgmatic configuration is throwing error messages and failing, without any change on my side except an update. I think it happens since the 2.1.3 release. I'm sure that my configuration worked for years before. I discovered that the bug is happening only when a configuration file read by Borg is a symlink using a relative path (not absolute path). See the following for reproduction and output.
P.S.: I'm a bit surprised this has not been reported before (I searched for), because I thought having symlinked configuration file is pretty common. Is there something specific to my system?
Thank you for the hard work!
Steps to reproduce
my-backup.yamlcontaining the bare minimum to make a backup:Instead of having
/borgmatic/my-backup.yamlas the path to which borgmatic tries to access, we have/home/borgmatic/my-backup.yaml.Actual behavior
Expected behavior
Other notes / implementation ideas
No response
borgmatic version
2.1.3
borgmatic installation method
Arch package
Borg version
1.4.4
Python version
3.14.3
Database version (if applicable)
No response
Operating system and version
ArchLinux
Thanks for filing this with all the reproduction steps! I'm able to reproduce it here on borgmatic 2.1.3 and 2.1.4. My guess is that this is a regression introduced in 2.1.3 by #1248. I'll have a look when I get a chance.
Looks like this regression was actually made in #1270 (and then probably surfaced via #1248). The #1270 change simply didn't work with configuration paths that were relative symlinks. The good news: Now it does work, because this is fixed in main and will be part of the next release!
In the meantime, a workaround might be to set
source_directories_must_exist: false. However then you'd be giving up that feature for the time being and you still might get some annoying warnings (but no errors). And then thebootstrapaction won't work for these config files until you have the actual fix.Another (better?) temporary workaround might be to disable the "bootstrap" data source hook in configuration.
Thank you so much for the quick fix! I indeed used the
source_directories_must_exist: falsein the meantime. :) CheersReleased in borgmatic 2.1.5!