hass-auto-backup icon indicating copy to clipboard operation
hass-auto-backup copied to clipboard

Auto backup can't purge backup on network storage

Open Zagrthos opened this issue 1 year ago • 7 comments

The problem

I have my system configured that it stores backups automatically on a remote network storage (my NAS basically). The storing and all works pretty fine but each time when it should purge an old backup (because of expiring times) it throws errors inside the Homeassistant log file.

What version of Auto Backup has the issue?

1.5.3

What version of Home Assistant are you running?

Core 2024.12.5

What type of installation are you running?

Home Assistant OS

If you're running HA OS/Supervised, what version of the Supervisor are you running?

Supervisor 2024.12.0

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-12-30 18:37:39.135 ERROR (MainThread) [custom_components.auto_backup.handlers] /backups/d2095cf7 return code 404.
2024-12-30 18:37:39.135 ERROR (MainThread) [custom_components.auto_backup] Failed to purge backup: 
2024-12-30 18:37:39.144 ERROR (MainThread) [custom_components.auto_backup.handlers] /backups/4f640b61 return code 404.
2024-12-30 18:37:39.144 ERROR (MainThread) [custom_components.auto_backup] Failed to purge backup:

Additional information

Edit, 2 mins later: The mentioned backup files aren't even there on the NAS storage. Why does it still want to delete them?

Zagrthos avatar Dec 30 '24 17:12 Zagrthos

I’m having the same issue…

ahwman avatar Dec 31 '24 13:12 ahwman

+1 /backups/7962229d return code 404. /backups/5294d4db return code 404. /backups/8580dde0 return code 404. /backups/5a2f06d4 return code 404.

l0choli avatar Jan 01 '25 07:01 l0choli

Same issue. I checked if the 'backups' directory somehow was created locally in case the network drive was not reachable, no luck.

There is no 'backups' directory on my network drive btw.

tommetje avatar Jan 04 '25 07:01 tommetje

Home Assistant handles the deletion of backups, and can only delete backups from /backups afaik, or maybe if you setup an alternate or additional backup location in the UI, but if the the backups are moved from the location or deleted externally HA will fail to delete the backup.

Auto Backup doesn't check if a backup was removed externally and just tries to delete it anyway, you can treat the error as more of a warning that it couldn't find the backup it was supposed to remove. This should be rare as you should set keep_days if you plan to move the backup from its original location.

jcwillox avatar Jan 05 '25 10:01 jcwillox

I had the same issue.

To get rid of the 404 error/warning I took a look in this ascii file /homeassistant/.storage/auto_backup.snapshots_expiry.

Be aware that if you use the HA File Editor add-on you will have to set it's Enforce Basepath to 'false' If set to true, access is limited to files within the /config directory.

The lines you're after have the same HEX number in them as mentioned in the error message. If you carefully remove the lines that refer to your '404 backups' and safe the changes, you wil be ok after a HA restart.

Doorshifter avatar Jan 05 '25 12:01 Doorshifter

I had the same issue.

To get rid of the 404 error/warning I took a look in this ascii file /homeassistant/.storage/auto_backup.snapshots_expiry.

Be aware that if you use the HA File Editor add-on you will have to set it's Enforce Basepath to 'false' If set to true, access is limited to files within the /config directory.

The lines you're after have the same HEX number in them as mentioned in the error message. If you carefully remove the lines that refer to your '404 backups' and safe the changes, you wil be ok after a HA restart.

This works, thanks for sharing.

tommetje avatar Jan 07 '25 12:01 tommetje

My problem: expired backups won't be deleted, but there is no error message. Backups are well.

`alias: Backup man./tägl. 1:30 description: "" triggers:

  • at: "01:30:00" trigger: time conditions: [] actions:
  • action: auto_backup.backup_full metadata: {} data: encrypted: false compressed: true location: HA_Backup_Fritzbox name: Backup-full-extern keep_days: 1
  • delay: hours: 0 minutes: 30 seconds: 0 milliseconds: 0 enabled: true
  • action: auto_backup.purge metadata: {} data: {} mode: single `

Matze-aaa avatar Apr 03 '25 21:04 Matze-aaa