Borg create errors don't show up at borgmatic verbosity zero #198

Closed
opened 2019-06-22 00:30:03 +00:00 by witten · 2 comments
Owner

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.

#### 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.
witten added the
bug
label 2019-06-22 00:30:10 +00:00
Author
Owner

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.

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.
Author
Owner

Just fixed this as described above, and released the fix in borgmatic 1.3.10.

Just fixed this as described above, and released the fix in borgmatic 1.3.10.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#198
No description provided.