YunoHost-Apps / borg_ynh

An experimental Borg implementation for YunoHost
https://www.borgbackup.org/
GNU Affero General Public License v3.0
19 stars 25 forks source link

Error not logged when `borg create` fails #97

Open fflorent opened 3 years ago

fflorent commented 3 years ago

Describe the bug

Sometimes, the borg create command fails in the backup_method script. I don't get any error log in /var/log/borg/, and I miss clues why the error occurs.

Context

NB: I use a distant borg repository which is not a Yunohost server (I tweak the value of the repository variable).

Steps to reproduce

Run systemctl start borg and ensure borg create fails I guess ¯_ (ツ)_/¯

Expected behavior

The error should be logged in /var/log/borg/...

Analysis

In lines invoking borg create and borg prune (here, here and here), I wonder why we redirect the output to /dev/null.

Cannot 2>&1 | log_with_timestamp be enough?

fflorent commented 2 years ago

Rereading my issue, I guess the point I missed is that error logs are put in /var/log/backup_borg.err.

Also I wonder if 8bb3888f81eff0cd487489eb65411601a70221d1 wouldn't actually fix the above request anyways (that we don't actually see errors in /var/log/borg/).

shukon commented 1 year ago

I still don't really get why we redirect output to /dev/null... I'm having trouble to debug issues with my borg_ynh - can you explain why we're discarding the output?

fflorent commented 1 year ago

I still don't really get why we redirect output to /dev/null... I'm having trouble to debug issues with my borg_ynh - can you explain why we're discarding the output?

Have you checked /var/log/backup_borg.err? (yeah, it not really intuitive)

shukon commented 1 year ago

I did and there are logs in there... however I don't see any actual output on what actually fails, I don't even get the Backup failed miserably error message, however the borg.service always fails, so something has to be amiss... I'll open up an issue if I actually find out anything about it, but the verbosity of /var/log/backup_borg.err seems to be minimal and the output of borg create and borg prune is suppressed, so I'll fiddle with the scripts first to get logs that are actually useful. Thanks for responding though. Discarding the logs just feels not so useful I guess?