Borg create errors don't show up at borgmatic verbosity zero #198
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#198
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
When Borg encounters an issue during archive creation (e.g. repository not found), if I'm at borgmatic verbosity level zero (the default), I see that there was an error, but I don't see any of Borg's output. This makes it difficult to debug the error without getting a repro and upping borgmatic's verbosity to one or higher.
Steps to reproduce
Run
borgmatic --create
with borgmatic's config file referencing a repository that doesn't exist.Actual behavior
borgmatic says that there was an error with the Borg command, with no indication as to what the error was.
Expected behavior
Borg's output/error is displayed.
Other notes / implementation ideas
Right now, all Borg create output is logged at INFO level.. with the exception of lines that start with the string "borg: error:", which are logged at ERROR. So upping the log level either all the time or only at certain verbosity levels would be one option.
I have a potential solution for this. Briefly: Record a sliding window of tailed Borg output until Borg exits. If Borg exits non-zero, include the recorded output in the summary at the end of execution. That way, 1. Logging continues to be real-time, 2. Logging at verbosity zero during a successful run continues to be mostly silent, and 3. Any output from a failed Borg run get surfaced as log level error (meaning it surfaces at any verbosity level).
The main downside of this solution is that some of this output can be repeated if the verbosity level is high, but that's mitigated by truncating it to the last n lines.
Just fixed this as described above, and released the fix in borgmatic 1.3.10.