YunoHost-Apps/borg_ynh

Borg_ynh didn't send any email alert on backup error

eauchat opened this issue · 2 comments

Describe the bug

For some time the backup server was down, but I didn't receive any alert email that the backup failed.
I'm using the setting mailalert: errors_only.
I didn't have this problem some months ago, before the mailalert setting existed. Wondering if it's related, or not.

Context

  • Hardware: computer
  • YunoHost version: 4.2.8.3
  • 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
  • Using, or trying to install package version/branch: 1.1.16~ynh24

Logs

These are the logs in /var/log/borg__2/211122_XXXX.err:

Failed to format translated string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Connection closed by remote host. Is borg working on the server?
Could not run script: /etc/yunohost/hooks.d/backup_method/05-borg__2_app
Custom backup method could not get past the 'backup' step
Failed to format translated string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Remote: ssh: connect to host backupServer.tld port 22: Network is unreachable
Connection closed by remote host. Is borg working on the server?
Could not run script: /etc/yunohost/hooks.d/backup_method/05-borg__2_app
Custom backup method could not get past the 'backup' step
Failed to format translated string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Remote: ssh: connect to host backupServer.tld port 22: Network is unreachable
Connection closed by remote host. Is borg working on the server?
Could not run script: /etc/yunohost/hooks.d/backup_method/05-borg__2_app
Custom backup method could not get past the 'backup' step
Failed to format translated string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Remote: ssh: connect to host backupServer.tld port 22: Network is unreachable
Connection closed by remote host. Is borg working on the server?
Could not run script: /etc/yunohost/hooks.d/backup_method/05-borg__2_app
Custom backup method could not get past the 'backup' step
Failed to format translated string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Remote: ssh: connect to host backupServer.tld port 22: Network is unreachable
Connection closed by remote host. Is borg working on the server?
Could not run script: /etc/yunohost/hooks.d/backup_method/05-borg__2_app
Custom backup method could not get past the 'backup' step
Failed to format translated string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Remote: ssh: connect to host backupServer.tld port 22: Network is unreachable
Connection closed by remote host. Is borg working on the server?
Could not run script: /etc/yunohost/hooks.d/backup_method/05-borg__2_app
Custom backup method could not get past the 'backup' step
Failed to format translated string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Remote: ssh: connect to host backupServer.tld port 22: Network is unreachable
Connection closed by remote host. Is borg working on the server?
Could not run script: /etc/yunohost/hooks.d/backup_method/05-borg__2_app
Custom backup method could not get past the 'backup' step
Failed to format translated string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Remote: ssh: connect to host backupServer.tld port 22: Network is unreachable
Connection closed by remote host. Is borg working on the server?
Could not run script: /etc/yunohost/hooks.d/backup_method/05-borg__2_app
Custom backup method could not get past the 'backup' step
Failed to format translated string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Remote: ssh: connect to host backupServer.tld port 22: Network is unreachable
Connection closed by remote host. Is borg working on the server?
Could not run script: /etc/yunohost/hooks.d/backup_method/05-borg__2_app
Custom backup method could not get past the 'backup' step
It's hightly recommended to make your backup when the service is stopped. Please stop synapse service with this command before to run the backup 'systemctl stop matrix-synapse.service'
Failed to format translated string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Connection closed by remote host. Is borg working on the server?
Could not run script: /etc/yunohost/hooks.d/backup_method/05-borg__2_app
Custom backup method could not get past the 'backup' step

These are the logs in /var/log/borg__2/211122_XXXX.log:

Creating a backup archive from the collected files...
The archive will contain about XX.XXGiB of data.
The operation 'Create a backup archive' could not be completed. Please share the full log of this operation using the command 'yunohost log share XXXXXXXX-XXXXXX-backup_create' to get help
Collecting files to be backed up for borg__2...
Loading installation settings...
Declaring files to be backed up...
Backup script completed for borg__2. (YunoHost will then actually copy those files to the archive).
Creating a backup archive from the collected files...
The archive will contain about XX.XXKiB of data.
The operation 'Create a backup archive' could not be completed. Please share the full log of this operation using the command 'yunohost log share XXXXXXXX-XXXXXX-backup_create' to get help
Collecting files to be backed up for APPNAME...
Loading installation settings...
Backing up the main app directory...
Backing up nginx web server configuration...
Backing up the PostgreSQL database...
Backing up fail2ban configuration
Backing up synapse configuration...
Backing up systemd configuration...
Backing up synapse data...
Backing up synapse log...
Backing up synapse hook...
Backup script completed for APPNAME. (YunoHost will then actually copy those files to the archive).
Creating a backup archive from the collected files...
The archive will contain about XX.XXGiB of data.
The operation 'Create a backup archive' could not be completed. Please share the full log of this operation using the command 'yunohost log share XXXXXXXX-XXXXXX-backup_create' to get help

Same here it stopped sending me emails for some reason....I have no idea why. It used to work. What I did was to change in config how to receive the emails, for 2 servers. From Always to only when an error occurs. Then I even changed back to Always. But it does not send any alerts of any sort.

#metoo
didn't receive the alert email on a failed attempt to login into the Borg server

2022-09-12 00:10:00,927: ERROR - Could not run script: /etc/yunohost/hooks.d/backup_method/05-borg_app
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/yunohost/hook.py", line 305, in hook_callback
    hook_return = hook_exec(
  File "/usr/lib/python3/dist-packages/yunohost/hook.py", line 393, in hook_exec
    raise YunohostError("hook_exec_failed", path=path)
yunohost.utils.error.YunohostError: Could not run script: /etc/yunohost/hooks.d/backup_method/05-borg_app