Skip to content
Snippets Groups Projects
Commit de7e32ba authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Merge branch...

Merge branch '623-status-page-throws-internal-server-error-if-backup-directory-not-found' into 'master'

Resolve "Status page throws internal server error if backup directory not found"

Closes #623

See merge request !920
parents 6f895443 70467783
No related branches found
No related tags found
1 merge request!920Resolve "Status page throws internal server error if backup directory not found"
Pipeline #50753 passed
Pipeline: AlekSIS

#50760

    ......@@ -21,6 +21,7 @@ Fixed
    * Phone numbers were not properly linked and suboptimally formatted on person page
    * Favicon upload failed with S3 storage.
    * Some preferences were required when they shouldn't, and vice versa.
    * IO errors on accessing backup directory in health check are now properly reported
    `2.6`_ - 2022-01-10
    -------------------
    ......
    ......@@ -33,7 +33,13 @@ class BaseBackupHealthCheck(BaseHealthCheckBackend):
    def check_status(self):
    storage = get_storage()
    backups = storage.list_backups(content_type=self.content_type)
    try:
    backups = storage.list_backups(content_type=self.content_type)
    except Exception as ex:
    self.add_error(_("Error accessing backup storage: {}").format(str(ex)))
    return
    if backups:
    last_backup = backups[:1]
    last_backup_time = dbbackup_utils.filename_to_date(last_backup[0])
    ......@@ -41,7 +47,7 @@ class BaseBackupHealthCheck(BaseHealthCheckBackend):
    # Check if backup is older than configured time
    if time_gone_since_backup.seconds > self.configured_seconds:
    self.add_error(_(f"Last backup {time_gone_since_backup}!"))
    self.add_error(_("Last backup {}!").format(time_gone_since_backup))
    else:
    self.add_error(_("No backup found!"))
    ......@@ -72,4 +78,4 @@ class BackupJobHealthCheck(BaseHealthCheckBackend):
    if not task:
    self.add_error(_("No backup result found!"))
    elif task and task.status != "SUCCESS":
    self.add_error(_(f"{task.status} - {task.result}"))
    self.add_error(f"{task.status} - {task.result}")
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment