"borgmatic restore --database all" should error when not actually restoring anything #246
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#246
Loading…
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
I'm trying to restore databases when I don't actually have any databases configured in borgmatic's configuration. A user might do this accidentally, not realizing that the restore they think is happening (because no error) is actually not restoring anything. Unless they look carefully at the output, they may not realize nothing happened.
Steps to reproduce (if a bug)
No databases configured in
test.yaml
. Some database dumps in the archive.Actual behavior (if a bug)
Expected behavior (if a bug)
Error!
Other notes / implementation ideas
Would also be good to check what happens when databases are configured, but none are found in the archive.
Environment
borgmatic version: 1.4.10.dev0
borgmatic installation method:
pip install --editable
Borg version: 1.1.10
Python version: 3.7.4
Database version (if applicable): PostgreSQL 11.5, MySQL Ver 15.1 Distrib 10.4.8-MariaDB
operating system and version: Manjaro stable
Potential data loss: This is a particularly nasty bug. What happened is that when no databases are configured, no dump patterns get passed to
borg extract
, which means borg extracts all files in the archive instead of just database dumps, which means it could extract over your actual non-database files! Super not good. I have a fix in hand, and will release it shortly.Fix released in borg 1.4.10. Upgrading is highly recommended!