borgmatic does not treat database dump command exit code 1 as error #310
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 assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
borgmatic-collective/borgmatic#310
Loading…
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
Since #258 if a database dump command errors (e.g.
pg_dumpreturns exit code 1), borgmatic no longer treats that as an error.Steps to reproduce
Using any valid borgmatic configuration file at
test.yaml:Actual behavior
pg_dumpclearly errors in the logs:But borgmatic doesn't error:
Expected behavior
borgmatic errors when
pg_dumpdoes.Other notes / implementation ideas
The reason this is happening is because of the way that #258 is executing both dumps and Borg create within a single function now:
execute_command_with_processes(). That function takes a singleerror_on_warningsparameter now, which is False in thecreateaction call, which means that exit code 1 for bothborg createand forpg_dumpare considered non-error.The fix is to somehow still consider
pg_dumpexit code 1 as an error. Theerror_on_warnings=Falseflag was originally introducing as a way forexecute_command*()callers to effectively say: "This is Borg. Treat it special."Environment
borgmatic version: 1.5.3
borgmatic installation method:
pip install --userBorg version:
1.1.11Python version:
3.8.2Database version (if applicable): 12.2
operating system and version: Manjaro 20.0
It possible that the database restore functionality has the opposite problem: Because the database restore command and the
borg extractcommand are executed in the same borgmatic function, anyborg extractwarnings (exit code 1) are interpreted as errors. But they should really be considered warnings and not cause borgmatic to error.Fixed in 1.5.4.