YunoHost-Apps/borg_ynh

Error not logged when `borg create` fails

fflorent opened this issue · 4 comments

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).

  • Hardware: VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...
  • YunoHost version: 4.2.8
  • I have access to my server: Through SSH + through the webadmin
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: no
    • If yes, please explain:
  • Using, or trying to install package version/branch:
  • If upgrading, current package version: can be found in the admin, or with yunohost app info $app_id

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?

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 8bb3888 wouldn't actually fix the above request anyways (that we don't actually see errors in /var/log/borg/).

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?

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)

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?