borgmatic does not treat database dump command exit code 1 as error #310
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#310
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
Since #258 if a database dump command errors (e.g.
pg_dump
returns 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_dump
clearly errors in the logs:But borgmatic doesn't error:
Expected behavior
borgmatic errors when
pg_dump
does.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_warnings
parameter now, which is False in thecreate
action call, which means that exit code 1 for bothborg create
and forpg_dump
are considered non-error.The fix is to somehow still consider
pg_dump
exit code 1 as an error. Theerror_on_warnings=False
flag 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 --user
Borg version:
1.1.11
Python version:
3.8.2
Database 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 extract
command are executed in the same borgmatic function, anyborg extract
warnings (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.