Setting --strip-components all
leads to no files being extracted #851
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#851
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
I had found a bug which wiped the database of my headscale service so I wanted to restore the database from backup. The database is sqlite and just backup'ed as a regular file.
Steps to reproduce
Actual behavior
No file is extracted.
Expected behavior
The file is extracted from backup like it is without setting
--strip-component all
:Which after you find the extracted file in
$PWD/opt/docker/headscale/data/db.sqlite
I would expect the file to be extracted to
$PWD/db.sqlite
with the command from the repro steps.Other notes / implementation ideas
I also have an Arch Linux install with version 1.8.10 and the issue also is present.
borgmatic version
1.8.9
borgmatic installation method
Debian package
Borg version
1.2.7
Python version
3.11.8
Database version (if applicable)
No response
Operating system and version
Debian GNU/Linux trixie/sid
Good catch.. What's apparently going on is that the
--path
value in your example has a leading slash, which causes the number of path components to strip to be miscalculated (off-by-one error), which causes Borg to ignore the path since the provided number of components to strip exceed the number of components in the path!Borg stores file paths within its archives without a leading slash, but apparently allows leading slashes on paths given to
extract
. So borgmatic with--strip-components all
should IMO be made to work that way as well. I'll make that fix as part of this ticket, but in the meantime you can just drop the leading slash and your example should work fine with the version of borgmatic you're using.Thanks for bringing this to my attention and slogging through the registration process.
Fixed in main! It'll be part of the next release. Thanks again.
Released in borgmatic 1.8.11!