sabeechen / hassio-google-drive-backup

Automatically create and sync Home Assistant backups into Google Drive
MIT License
3.21k stars 198 forks source link

Can't delete old backups #962

Closed krp87b closed 11 months ago

krp87b commented 11 months ago

I can't delete a few backups. I went as far as trying to uninstall the addon and then reinstalled it but the error stayed. I tried manually deleting the backup and It says HA refused to delete the backup. The addon is working but only storing to HA, not Google Drive. screenshot

Description:
If you have anything else that could help explain what happened, click "Markdown" above and write it here.

Addon version: 0.112.1 Home Assistant Version: 2023.12.3 Supervisor Version: 2023.12.0 Supervisor Channel: stable Hassos Version: 11.2 Docker Version: 24.0.7 Architecture: aarch64 Machine: green Date: 2023-12-23T23:39:56.669924+00:00 Timezone: America/New_York Failure Time: 2023-12-23T23:39:00.198736+00:00 Last Good Sync: 2023-12-23T23:38:59.699071+00:00 Next Sync: 2023-12-24T01:39:00.198736+00:00 Next Backup: 2023-12-24T10:00:00+00:00 Next Cache Warm: 2023-12-24T01:33:55.472858+00:00 Time Offset: 0.0

Exception:

  addon/backup/ha/harequests.py:105 (delete)
  addon/backup/ha/harequests.py:34 (wrap_and_call)
  addon/backup/ha/harequests.py:280 (_sendHassioData)
  addon/backup/ha/harequests.py:225 (_validateHassioReply)
  /site-packages/aiohttp/client_reqrep.py:1059 (raise_for_status)
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('http://supervisor/backups/14aa8623')
Whose handling caused:
  addon/backup/model/coordinator.py:198 (_sync)
  addon/backup/model/model.py:210 (sync)
  addon/backup/model/model.py:382 (_purge)
  addon/backup/model/model.py:280 (deleteBackup)
  addon/backup/ha/hasource.py:355 (delete)
  addon/backup/ha/harequests.py:34 (wrap_and_call)
  addon/backup/ha/harequests.py:111 (delete)
backup.exceptions.exceptions.HomeAssistantDeleteError

Backups:

 {
    "HomeAssistant": {
        "backups": 5,
        "retained": 0,
        "deletable": 5,
        "name": "HomeAssistant",
        "title": "Home Assistant",
        "latest": "2023-12-23T21:41:09Z",
        "max": 14,
        "enabled": true,
        "icon": "home-assistant",
        "ignored": 0,
        "detail": "",
        "size": "0.0 B",
        "ignored_size": "0.0 B"
    },
    "GoogleDrive": {
        "backups": 5,
        "retained": 0,
        "deletable": 5,
        "name": "GoogleDrive",
        "title": "Google Drive",
        "latest": "2023-12-23T21:41:09Z",
        "max": 14,
        "enabled": true,
        "icon": "google-drive",
        "ignored": 0,
        "detail": "krp87b@gmail.com",
        "size": "1.2 GB",
        "ignored_size": "0.0 B",
        "free_space": "49.9 GB"
    }
}
Config:
 {
    "Setting.MAX_BACKUPS_IN_HA": 14,
    "Setting.MAX_BACKUPS_IN_GOOGLE_DRIVE": 14,
    "Setting.DAYS_BETWEEN_BACKUPS": 1.0,
    "Setting.DELETE_IGNORED_AFTER_DAYS": 3.0,
    "Setting.BACKUP_NAME": "REDACTED",
    "Setting.BACKUP_TIME_OF_DAY": "05:00",
    "Setting.SPECIFY_BACKUP_FOLDER": true,
    "Setting.BACKUP_STORAGE": "Synology_NAS_Backup",
    "Setting.DELETE_AFTER_UPLOAD": true
}
Addon Logs:
 12-23 18:33:32 INFO [backup.ui.uiserver] Starting server on port 8099
12-23 18:33:32 INFO [backup.ui.uiserver] Server started
12-23 18:33:32 DEBUG [backup.model.syncer] Sync requested by Coordinator
12-23 18:33:32 INFO [backup.model.coordinator] Syncing Backups
12-23 18:34:02 INFO [backup.drive.drivesource] Saving new Google Drive credentials
12-23 18:34:02 DEBUG [backup.model.syncer] Sync requested by GoogleDrive
12-23 18:34:02 INFO [backup.model.coordinator] Syncing Backups
12-23 18:34:02 INFO [backup.drive.folderfinder] Found Home Assistant Yellow
12-23 18:34:03 ERROR [backup.model.coordinator] A backup folder already exists.  Please visit the add-on Web UI to select where to backup.
12-23 18:34:03 INFO [backup.model.coordinator] I'll try again in 2 hours
12-23 18:38:51 INFO [backup.drive.folderfinder] Saving backup folder: 1sRT3hK6O3aiaR5kYs1GCweLZsXuPkVhF
12-23 18:38:51 INFO [backup.model.coordinator] Syncing Backups
12-23 18:38:51 ERROR [backup.model.coordinator] The add-on has been configured to delete more than one older backups.  Please confirm this by visiting the add-on's web UI or by setting the config option 'confirm_multiple_deletes'=false in your add-on configuration.
12-23 18:38:51 INFO [backup.model.coordinator] I'll try again in 2 hours
12-23 18:38:59 INFO [backup.model.coordinator] Syncing Backups
12-23 18:39:00 INFO [backup.ha.hasource] Deleting 'Full Backup 2023-12-21 03:00:00' from Home Assistant
12-23 18:39:00 ERROR [backup.model.coordinator] Home Assistant refused to delete the backup.
12-23 18:39:00 INFO [backup.model.coordinator] I'll try again in 2 hours
Supervisor Logs:
 23-12-23 18:33:25 INFO (MainThread) [supervisor.api.middleware.security] /network/info access from a0d7b954_ssh
23-12-23 18:33:25 INFO (MainThread) [supervisor.api.middleware.security] /host/info access from a0d7b954_ssh
23-12-23 18:33:25 INFO (MainThread) [supervisor.api.middleware.security] /core/info access from a0d7b954_ssh
23-12-23 18:33:30 INFO (MainThread) [supervisor.docker.addon] Starting Docker add-on ghcr.io/sabeechen/hassio-google-drive-backup-aarch64 with version 0.112.1
23-12-23 18:33:30 ERROR (MainThread) [supervisor.api.ingress] Ingress error: Cannot connect to host 172.30.33.2:8099 ssl:default [Connect call failed ('172.30.33.2', 8099)]
23-12-23 18:33:32 INFO (MainThread) [supervisor.api.middleware.security] /core/info access from cebe7a76_hassio_google_drive_backup
23-12-23 18:33:32 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/info access from cebe7a76_hassio_google_drive_backup
23-12-23 18:33:32 INFO (MainThread) [supervisor.api.middleware.security] /mounts access from cebe7a76_hassio_google_drive_backup
23-12-23 18:33:32 INFO (MainThread) [supervisor.api.middleware.security] /addons access from cebe7a76_hassio_google_drive_backup
23-12-23 18:33:32 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/info access from cebe7a76_hassio_google_drive_backup
23-12-23 18:33:32 INFO (MainThread) [supervisor.api.middleware.security] /backups access from cebe7a76_hassio_google_drive_backup
23-12-23 18:33:32 INFO (MainThread) [supervisor.api.middleware.security] /backups/bdb8df8a/info access from cebe7a76_hassio_google_drive_backup
23-12-23 18:33:32 INFO (MainThread) [supervisor.api.middleware.security] /backups/4a7f5865/info access from cebe7a76_hassio_google_drive_backup
23-12-23 18:33:32 INFO (MainThread) [supervisor.api.middleware.security] /backups/14aa8623/info access from cebe7a76_hassio_google_drive_backup
23-12-23 18:33:32 INFO (MainThread) [supervisor.api.middleware.security] /backups/c018f56d/info access from cebe7a76_hassio_google_drive_backup
23-12-23 18:33:32 INFO (MainThread) [supervisor.api.middleware.security] /backups/eb3da235/info access from cebe7a76_hassio_google_drive_backup
23-12-23 18:34:02 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/info access from cebe7a76_hassio_google_drive_backup
23-12-23 18:34:02 INFO (MainThread) [supervisor.api.middleware.security] /backups access from cebe7a76_hassio_google_drive_backup
23-12-23 18:34:05 INFO (MainThread) [supervisor.api.middleware.security] /core/info access from cebe7a76_hassio_google_drive_backup
23-12-23 18:34:05 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/info access from cebe7a76_hassio_google_drive_backup
23-12-23 18:34:05 INFO (MainThread) [supervisor.api.middleware.security] /mounts access from cebe7a76_hassio_google_drive_backup
23-12-23 18:34:05 INFO (MainThread) [supervisor.api.middleware.security] /addons access from cebe7a76_hassio_google_drive_backup
23-12-23 18:38:51 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/info access from cebe7a76_hassio_google_drive_backup
23-12-23 18:38:51 INFO (MainThread) [supervisor.api.middleware.security] /backups access from cebe7a76_hassio_google_drive_backup
23-12-23 18:38:59 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/info access from cebe7a76_hassio_google_drive_backup
23-12-23 18:38:59 INFO (MainThread) [supervisor.api.middleware.security] /backups access from cebe7a76_hassio_google_drive_backup
23-12-23 18:39:00 INFO (MainThread) [supervisor.api.middleware.security] /backups/14aa8623 access from cebe7a76_hassio_google_drive_backup
23-12-23 18:39:00 ERROR (MainThread) [supervisor.backups.manager] Can't remove backup 14aa8623: [Errno 2] No such file or directory: '/data/mounts/Synology_NAS_Backup/14aa8623.tar'
23-12-23 18:39:56 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/logs access from cebe7a76_hassio_google_drive_backup
Home Assistant Core Logs:
 2023-12-23 18:26:31.509 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-12-23 18:26:31.512 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration govee_lan which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-12-23 18:26:31.514 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration localtuya which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-12-23 18:26:47.531 WARNING (MainThread) [homeassistant.setup] Setup of hassio is taking over 10 seconds.
2023-12-23 18:26:49.611 WARNING (MainThread) [hass_nabucasa.cloud_api] Fetched https://alexa-api.nabucasa.com/access_token (400)
2023-12-23 18:27:01.481 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform google_wifi is taking over 10 seconds.
2023-12-23 18:27:17.967 WARNING (MainThread) [homeassistant.helpers.entity] Updating state for calendar.tina_paul_calendar (<class 'homeassistant.components.google.calendar.GoogleCalendarEntity'>) took 1.444 seconds. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+google%22
2023-12-23 18:27:19.651 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.apollo_msr_1_bba1bc_ltr390_ambient_light (<class 'homeassistant.components.esphome.sensor.EsphomeSensor'>) is using native unit of measurement '#' which is not a valid unit for the device class ('illuminance') it is using; expected one of ['lx']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+esphome%22
2023-12-23 18:27:19.685 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.apollo_msr_1_bba1bc_ltr390_uv_index (<class 'homeassistant.components.esphome.sensor.EsphomeSensor'>) is using native unit of measurement 'UVI' which is not a valid unit for the device class ('illuminance') it is using; expected one of ['lx']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+esphome%22
2023-12-23 18:27:19.688 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.apollo_msr_1_bba1bc_ltr390_uv (<class 'homeassistant.components.esphome.sensor.EsphomeSensor'>) is using native unit of measurement '#' which is not a valid unit for the device class ('illuminance') it is using; expected one of ['lx']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+esphome%22
2023-12-23 18:27:51.700 ERROR (Thread-14) [pychromecast.socket_client] [Speaker MBath(192.168.86.41):8009] Error reading from socket.
2023-12-23 18:27:51.700 WARNING (Thread-14) [pychromecast.socket_client] [Speaker MBath(192.168.86.41):8009] Error communicating with socket, resetting connection
2023-12-23 18:27:51.725 ERROR (Thread-14) [pychromecast.socket_client] [Speaker MBath(192.168.86.41):8009] Failed to connect to service ServiceInfo(type='mdns', data='Google-Nest-Mini-49d786594c42ba6570de1399ac1efdcb._googlecast._tcp.local.'), retrying in 5.0s
2023-12-23 18:27:54.120 ERROR (Thread-13) [pychromecast.socket_client] [Speaker MBed(192.168.86.198):8009] Error reading from socket.
2023-12-23 18:27:54.121 WARNING (Thread-13) [pychromecast.socket_client] [Speaker MBed(192.168.86.198):8009] Error communicating with socket, resetting connection
2023-12-23 18:27:54.183 ERROR (Thread-13) [pychromecast.socket_client] [Speaker MBed(192.168.86.198):8009] Failed to connect to service ServiceInfo(type='mdns', data='Google-Nest-Mini-bf49c0cb9f85023e8c281269ba880cd2._googlecast._tcp.local.'), retrying in 5.0s
2023-12-23 18:27:54.349 ERROR (Thread-16) [pychromecast.socket_client] [Speaker TR(192.168.86.197):8009] Error reading from socket.
2023-12-23 18:27:54.349 WARNING (Thread-16) [pychromecast.socket_client] [Speaker TR(192.168.86.197):8009] Error communicating with socket, resetting connection
2023-12-23 18:27:54.371 ERROR (Thread-16) [pychromecast.socket_client] [Speaker TR(192.168.86.197):8009] Failed to connect to service ServiceInfo(type='mdns', data='Google-Nest-Mini-6cef54eb76e13f6f1facc4dda942f4be._googlecast._tcp.local.'), retrying in 5.0s
2023-12-23 18:27:54.507 ERROR (Thread-22) [pychromecast.socket_client] [Speaker LR(192.168.86.88):8009] Error reading from socket.
2023-12-23 18:27:54.507 WARNING (Thread-22) [pychromecast.socket_client] [Speaker LR(192.168.86.88):8009] Error communicating with socket, resetting connection
2023-12-23 18:27:54.558 ERROR (Thread-22) [pychromecast.socket_client] [Speaker LR(192.168.86.88):8009] Failed to connect to service ServiceInfo(type='mdns', data='Nest-Audio-b5e1e4f649a7784d4f1ff481b8589fb7._googlecast._tcp.local.'), retrying in 5.0s
2023-12-23 18:27:59.057 ERROR (Thread-15) [pychromecast.socket_client] [Speaker EO(192.168.86.38):8009] Error reading from socket.
2023-12-23 18:27:59.058 WARNING (Thread-15) [pychromecast.socket_client] [Speaker EO(192.168.86.38):8009] Error communicating with socket, resetting connection
2023-12-23 18:27:59.086 ERROR (Thread-15) [pychromecast.socket_client] [Speaker EO(192.168.86.38):8009] Failed to connect to service ServiceInfo(type='mdns', data='Nest-Audio-419d57f120affe49282e2a4acf4e62db._googlecast._tcp.local.'), retrying in 5.0s
2023-12-23 18:32:13.944 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.camera_doorbell] Error from stream worker: Error opening stream (HTTP_NOT_FOUND, Server returned 404 Not Found) rtsps://stream-uc2-alfa.dropcam.com:443/sdm_live_stream/CiUA2vuxr9qzOFcuwgp9jK_zbUhAO4eUR_5bC1OZ7fGd73QxdSRKEnEAPT1gByZ7hSMKn_kzYWN-8xodMGkkfxv31pz0O26Q-5qTHABqyrYsG4xA8oNC77fUC7daCoouILRvM2iSy00kT07UrPgOOms0FZal_ElUzM-b2alhy-Sr8Zkz_YV08DCRir60zqyZTePqk1hbHwgrww?auth=****
2023-12-23 18:32:19.922 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.camera_front_yard] Error from stream worker: Error opening stream (HTTP_NOT_FOUND, Server returned 404 Not Found) rtsps://stream-uc2-delta.dropcam.com:443/sdm_live_stream/CiUA2vuxr9GelnXtzXHQy3ZsVnemlZdcq26fUOXPgeeAMKfmu4TZEnEAPT1gB3MI-09hPp8NERfR-omc70m5N8qHPyYNsBKA8Jh4J2d_0TDNt_-MiAnebKUAahqvLopoWkmjByVnLZEQbiTmnxwU1rOp5gZJGFHaDEQBx9GFU30hKDHTwiVMejWEXaAwtRDgbpQwV80pU7Pv5w?auth=****
2023-12-23 18:36:46.347 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.camera_front_yard] Error from stream worker: Error opening stream (HTTP_NOT_FOUND, Server returned 404 Not Found) rtsps://stream-uc2-delta.dropcam.com:443/sdm_live_stream/CiUA2vuxr9GelnXtzXHQy3ZsVnemlZdcq26fUOXPgeeAMKfmu4TZEnEAPT1gB3MI-09hPp8NERfR-omc70m5N8qHPyYNsBKA8Jh4J2d_0TDNt_-MiAnebKUAahqvLopoWkmjByVnLZEQbiTmnxwU1rOp5gZJGFHaDEQBx9GFU30hKDHTwiVMejWEXaAwtRDgbpQwV80pU7Pv5w?auth=****
2023-12-23 18:38:35.138 WARNING (Thread-13) [pychromecast.socket_client] [Speaker MBed(192.168.86.198):8009] Heartbeat timeout, resetting connection
sabeechen commented 11 months ago

The problem is here, from your supervisor logs:

[supervisor.backups.manager] Can't remove backup 14aa8623: [Errno 2] No such file or directory: '/data/mounts/Synology_NAS_Backup/14aa8623.tar'

Home Assistant is having trouble deleting the file from your NAS. Its likely a permissions problem in synology, but there are so many ways to setup a share that it's hard to provide more guidance.

krp87b commented 11 months ago

Is there a way to just delete everything and start the install over? Because I did an uninstall and then reinstalled it but it picked up things from the old install. I won't use my NAS on the next install. In fact, I removed it now but its still not uploading to my Google Drive anymore.

sabeechen commented 11 months ago

This add-on is just seeing the backups that home assistant says are there, it'll need to be fixed in home assistant. You should be able just remove the synology share from home assistant if you want to stop using it.