Database backup runtime directory error #999
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
I can't seem to get any combination of runtime_directory and database backups to work since this change that went out in 1.9.5.
It always triggers the ValueError below pretty much whatever I do.
Any ideas?
Steps to reproduce
No response
Actual behavior
No response
Expected behavior
No response
Other notes / implementation ideas
No response
borgmatic version
1.9.5-1.9.10
borgmatic installation method
pip install, homebrew
Borg version
1.4.0
Python version
3.12.9
Database version (if applicable)
No response
Operating system and version
No response
Can I get a look at your configuration and excludes to help diagnose this? Also, when you run borgmatic with
--verbosity 2, what is the runtime directory displayed? It should show up on line that says: "Using runtime directory ..."Thanks!
Sure, slightly truncated config:
And the runtime directory line is showing as
Using runtime directory /var/folders/h3/hh7xwqyj3bxdjdlkpnqlyl940000gp/T/borgmatic-499_rck4/borgmatic@witten Is there a chance that the
if not skip_pathscondition should beif skip_paths? I will admit I don't fully understand the point of what it's doing, but it seems like it might be backwards to me.Interesting, yeah, I don't see anything in your config that would obviously overlap the runtime directory. One thing you can do is look at the output of a(See below!)borgmatic createrun with--files(which you might not actually need since you've already got--list --filter=AMEin yourextra_borg_options). That should display exactly what's being excluded (via thexprefix). To temporarily get past the error so you can see that, you can add--dry-runwhich should suppress the ValueError.That code is pretty tricky, and maybe needs better commenting and/or variable naming. What's going on is that
pathsis the list of all file paths to backup as determined by a Borgcreatedry run—file paths that have not been otherwise excluded. Thenskip_pathsis the subset of those files paths contained by the borgmatic runtime directory. If there are none (if not skip_paths:), that means somewhere along the way, the borgmatic runtime directory (which gets auto-included by borgmatic) got excluded by the user (e.g. viaexclude_patternsor similar), and therefore we should error.Phew.
So. Seeing your excludes would help determine what if anything is causing the runtime directory to get excluded. It's also possible, of course, that something is going wrong in the logic described above....
Hold up! I just tried your
extra_borg_options:locally, specifically thecreate, and even more explicitly the--filter=AMEand got a repro of your error! I think what's going on is that the--filter=AMEis getting passed to the internal borgmaticborg create --dry-runin that function (collect_special_file_paths()) and causing the dry-run output to list zero file paths—which triggers the error above because it thinks the borgmatic runtime directory has been excluded.Temporarily, I think you can remove
--filter AMEand that should let you bypass the error. But in terms of fixing this for real, I think I need to make this function ignore or override any user--filteroptions so as not to inadvertently trigger the error.Yep, removing the
--filter=AMEworks! I also removed--listso it didn't take forever to run. Thanks very much for figuring it out!Thanks for your detailed repro info! That definitely helped. Okay, I'll work on coming up with a fix so you can add back
--filter=AMEif you want.I went ahead and implemented a fix for this. It turned out that
argparsewas probably overkill, and instead I managed to iterate through the arguments such that I could filter out both--filterand its value. Thanks again for your help here!The fix will be part of the next release.
Released in borgmatic 1.9.11!