sabeechen / hassio-google-drive-backup

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

Adding Support for Nas storage that isn't avadible 24/7 #891

Open Adriankor opened 1 year ago

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

Addon version: 0.111.1 Home Assistant Version: 2023.7.2 Supervisor Version: 2023.07.1 Supervisor Channel: stable Hassos Version: 10.3 Docker Version: 23.0.6 Architecture: aarch64 Machine: raspberrypi4-64 Date: 2023-07-17T06:06:54.299612+00:00 Timezone: Europe/Berlin Failure Time: 2023-07-17T04:11:10.047682+00:00 Last Good Sync: 2023-07-17T04:10:59.764099+00:00 Next Sync: 2023-07-17T06:11:10.047682+00:00 Next Backup: 2023-07-17T09:00:00+00:00 Next Cache Warm: 2023-07-17T06:10:00.802081+00:00 Time Offset: 0.0

Exception:

  addon/backup/model/coordinator.py:198 (_sync)
  addon/backup/model/model.py:203 (sync)
  addon/backup/model/model.py:317 (_syncBackups)
  addon/backup/ha/hasource.py:270 (get)
  addon/backup/ha/harequests.py:34 (wrap_and_call)
  addon/backup/ha/harequests.py:135 (backups)
  addon/backup/ha/harequests.py:34 (wrap_and_call)
  addon/backup/ha/harequests.py:269 (_getHassioData)
  addon/backup/ha/harequests.py:225 (_validateHassioReply)
  /site-packages/aiohttp/client_reqrep.py:1005 (raise_for_status)
aiohttp.client_exceptions.ClientResponseError: 500, message='Internal Server Error', url=URL('http://supervisor/backups')

Backups:

 {
    "HomeAssistant": {
        "backups": 11,
        "retained": 1,
        "deletable": 10,
        "name": "HomeAssistant",
        "title": "Home Assistant",
        "latest": "2023-07-16T15:27:38Z",
        "max": 10,
        "enabled": true,
        "icon": "home-assistant",
        "ignored": 2,
        "detail": "",
        "size": "5.5 GB",
        "ignored_size": "239.7 MB"
    },
    "GoogleDrive": {
        "backups": 5,
        "retained": 0,
        "deletable": 5,
        "name": "GoogleDrive",
        "title": "Google Drive",
        "latest": "2023-07-16T15:27:38Z",
        "max": 5,
        "enabled": true,
        "icon": "google-drive",
        "ignored": 0,
        "detail": "censored@gmail.com",
        "size": "2.3 GB",
        "ignored_size": "0.0 B",
        "free_space": "10.2 GB"
    }
}
Config:
 {
    "Setting.MAX_BACKUPS_IN_HA": 10,
    "Setting.MAX_BACKUPS_IN_GOOGLE_DRIVE": 5,
    "Setting.DAYS_BETWEEN_BACKUPS": 1.0,
    "Setting.DELETE_IGNORED_AFTER_DAYS": 7.0,
    "Setting.BACKUP_NAME": "REDACTED",
    "Setting.BACKUP_TIME_OF_DAY": "11:00",
    "Setting.BACKUP_PASSWORD": "REDACTED",
    "Setting.SEND_ERROR_REPORTS": true
}
Addon Logs:
 07-17 03:24:58 INFO [backup.model.coordinator] I'll try again in 5 minutes, 20 seconds
07-17 03:25:21 DEBUG [backup.model.destinationprecache] Preemptively retrieving and caching info from the backup destination to avoid peak demand
07-17 03:30:18 DEBUG [backup.model.syncer] Sync requested by Coordinator
07-17 03:30:18 INFO [backup.model.coordinator] Syncing Backups
07-17 03:30:28 ERROR [backup.model.coordinator] 
  addon/backup/model/coordinator.py:198 (_sync)
  addon/backup/model/model.py:203 (sync)
  addon/backup/model/model.py:317 (_syncBackups)
  addon/backup/ha/hasource.py:270 (get)
  addon/backup/ha/harequests.py:34 (wrap_and_call)
  addon/backup/ha/harequests.py:135 (backups)
  addon/backup/ha/harequests.py:34 (wrap_and_call)
  addon/backup/ha/harequests.py:269 (_getHassioData)
  addon/backup/ha/harequests.py:225 (_validateHassioReply)
  /site-packages/aiohttp/client_reqrep.py:1005 (raise_for_status)
aiohttp.client_exceptions.ClientResponseError: 500, message='Internal Server Error', url=URL('http://supervisor/backups')

07-17 03:30:28 INFO [backup.model.coordinator] I'll try again in 10 minutes, 40 seconds
07-17 03:31:22 DEBUG [backup.model.destinationprecache] Preemptively retrieving and caching info from the backup destination to avoid peak demand
07-17 03:41:08 DEBUG [backup.model.syncer] Sync requested by Coordinator
07-17 03:41:08 INFO [backup.model.coordinator] Syncing Backups
07-17 03:41:19 ERROR [backup.model.coordinator] 
  addon/backup/model/coordinator.py:198 (_sync)
  addon/backup/model/model.py:203 (sync)
  addon/backup/model/model.py:317 (_syncBackups)
  addon/backup/ha/hasource.py:270 (get)
  addon/backup/ha/harequests.py:34 (wrap_and_call)
  addon/backup/ha/harequests.py:135 (backups)
  addon/backup/ha/harequests.py:34 (wrap_and_call)
  addon/backup/ha/harequests.py:269 (_getHassioData)
  addon/backup/ha/harequests.py:225 (_validateHassioReply)
  /site-packages/aiohttp/client_reqrep.py:1005 (raise_for_status)
aiohttp.client_exceptions.ClientResponseError: 500, message='Internal Server Error', url=URL('http://supervisor/backups')

07-17 03:41:19 INFO [backup.model.coordinator] I'll try again in 21 minutes, 20 seconds
07-17 04:01:22 DEBUG [backup.model.destinationprecache] Preemptively retrieving and caching info from the backup destination to avoid peak demand
07-17 04:02:39 DEBUG [backup.model.syncer] Sync requested by Coordinator
07-17 04:02:39 INFO [backup.model.coordinator] Syncing Backups
07-17 04:02:49 ERROR [backup.model.coordinator] 
  addon/backup/model/coordinator.py:198 (_sync)
  addon/backup/model/model.py:203 (sync)
  addon/backup/model/model.py:317 (_syncBackups)
  addon/backup/ha/hasource.py:270 (get)
  addon/backup/ha/harequests.py:34 (wrap_and_call)
  addon/backup/ha/harequests.py:135 (backups)
  addon/backup/ha/harequests.py:34 (wrap_and_call)
  addon/backup/ha/harequests.py:269 (_getHassioData)
  addon/backup/ha/harequests.py:225 (_validateHassioReply)
  /site-packages/aiohttp/client_reqrep.py:1005 (raise_for_status)
aiohttp.client_exceptions.ClientResponseError: 500, message='Internal Server Error', url=URL('http://supervisor/backups')

07-17 04:02:49 INFO [backup.model.coordinator] I'll try again in 42 minutes, 40 seconds
07-17 04:39:23 DEBUG [backup.model.destinationprecache] Preemptively retrieving and caching info from the backup destination to avoid peak demand
07-17 04:39:23 DEBUG [backup.drive.driverequests] Requesting refreshed Google Drive credentials
07-17 04:45:29 DEBUG [backup.model.syncer] Sync requested by Coordinator
07-17 04:45:29 INFO [backup.model.coordinator] Syncing Backups
07-17 04:45:39 ERROR [backup.model.coordinator] 
  addon/backup/model/coordinator.py:198 (_sync)
  addon/backup/model/model.py:203 (sync)
  addon/backup/model/model.py:317 (_syncBackups)
  addon/backup/ha/hasource.py:270 (get)
  addon/backup/ha/harequests.py:34 (wrap_and_call)
  addon/backup/ha/harequests.py:135 (backups)
  addon/backup/ha/harequests.py:34 (wrap_and_call)
  addon/backup/ha/harequests.py:269 (_getHassioData)
  addon/backup/ha/harequests.py:225 (_validateHassioReply)
  /site-packages/aiohttp/client_reqrep.py:1005 (raise_for_status)
aiohttp.client_exceptions.ClientResponseError: 500, message='Internal Server Error', url=URL('http://supervisor/backups')

07-17 04:45:39 INFO [backup.model.coordinator] I'll try again in 1 hours, 25 minutes, 20 seconds
07-17 06:00:25 DEBUG [backup.model.destinationprecache] Preemptively retrieving and caching info from the backup destination to avoid peak demand
07-17 06:00:25 DEBUG [backup.drive.driverequests] Requesting refreshed Google Drive credentials
07-17 06:10:59 DEBUG [backup.model.syncer] Sync requested by Coordinator
07-17 06:10:59 INFO [backup.model.coordinator] Syncing Backups
07-17 06:11:10 ERROR [backup.model.coordinator] 
  addon/backup/model/coordinator.py:198 (_sync)
  addon/backup/model/model.py:203 (sync)
  addon/backup/model/model.py:317 (_syncBackups)
  addon/backup/ha/hasource.py:270 (get)
  addon/backup/ha/harequests.py:34 (wrap_and_call)
  addon/backup/ha/harequests.py:135 (backups)
  addon/backup/ha/harequests.py:34 (wrap_and_call)
  addon/backup/ha/harequests.py:269 (_getHassioData)
  addon/backup/ha/harequests.py:225 (_validateHassioReply)
  /site-packages/aiohttp/client_reqrep.py:1005 (raise_for_status)
aiohttp.client_exceptions.ClientResponseError: 500, message='Internal Server Error', url=URL('http://supervisor/backups')

07-17 06:11:10 INFO [backup.model.coordinator] I'll try again in 2 hours
07-17 08:03:26 DEBUG [backup.model.destinationprecache] Preemptively retrieving and caching info from the backup destination to avoid peak demand
07-17 08:03:26 DEBUG [backup.drive.driverequests] Requesting refreshed Google Drive credentials
Supervisor Logs:
 23-07-17 07:51:47 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
23-07-17 07:51:47 INFO (MainThread) [supervisor.resolution.fixup] Starting system autofix at state CoreState.RUNNING
23-07-17 07:51:47 INFO (MainThread) [supervisor.resolution.fixup] System autofix complete
23-07-17 07:54:44 INFO (MainThread) [supervisor.homeassistant.secrets] Request secret mariadb_user
23-07-17 07:54:44 INFO (MainThread) [supervisor.homeassistant.secrets] Request secret mariadb_pass
23-07-17 07:54:44 INFO (MainThread) [supervisor.homeassistant.secrets] Request secret mariadb_user
23-07-17 07:54:44 INFO (MainThread) [supervisor.homeassistant.secrets] Request secret backup_password
23-07-17 07:56:11 INFO (MainThread) [supervisor.homeassistant.secrets] Request secret backup_password
23-07-17 07:56:29 WARNING (MainThread) [supervisor.api.ingress] No valid ingress session None
23-07-17 07:56:51 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API token
23-07-17 07:58:29 INFO (MainThread) [supervisor.homeassistant.secrets] Request secret backup_password
23-07-17 07:58:30 INFO (MainThread) [supervisor.homeassistant.secrets] Request secret backup_password
23-07-17 07:58:30 INFO (MainThread) [supervisor.api.middleware.security] /core/info access from cebe7a76_hassio_google_drive_backup
23-07-17 07:58:30 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/info access from cebe7a76_hassio_google_drive_backup
23-07-17 07:58:30 INFO (MainThread) [supervisor.api.middleware.security] /mounts access from cebe7a76_hassio_google_drive_backup
23-07-17 07:58:30 INFO (MainThread) [supervisor.api.middleware.security] /addons access from cebe7a76_hassio_google_drive_backup
23-07-17 07:59:50 INFO (MainThread) [supervisor.homeassistant.secrets] Request secret mariadb_user
23-07-17 07:59:50 INFO (MainThread) [supervisor.homeassistant.secrets] Request secret mariadb_pass
23-07-17 07:59:50 INFO (MainThread) [supervisor.homeassistant.secrets] Request secret mariadb_user
23-07-17 07:59:50 INFO (MainThread) [supervisor.homeassistant.secrets] Request secret backup_password
23-07-17 08:01:20 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/logs access from cebe7a76_hassio_google_drive_backup
23-07-17 08:01:21 INFO (MainThread) [supervisor.api.middleware.security] /core/logs access from cebe7a76_hassio_google_drive_backup
23-07-17 08:01:39 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/logs access from cebe7a76_hassio_google_drive_backup
23-07-17 08:01:39 INFO (MainThread) [supervisor.api.middleware.security] /core/logs access from cebe7a76_hassio_google_drive_backup
23-07-17 08:04:56 INFO (MainThread) [supervisor.homeassistant.secrets] Request secret mariadb_user
23-07-17 08:04:56 INFO (MainThread) [supervisor.homeassistant.secrets] Request secret mariadb_pass
23-07-17 08:04:56 INFO (MainThread) [supervisor.homeassistant.secrets] Request secret mariadb_user
23-07-17 08:04:56 INFO (MainThread) [supervisor.homeassistant.secrets] Request secret backup_password
23-07-17 08:06:54 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/logs access from cebe7a76_hassio_google_drive_backup
Home Assistant Core Logs:
 s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun home-assistant (no readiness notification)
s6-rc: info: service legacy-services successfully started
2023-07-16 22:23:07.860 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration dwains_dashboard 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-07-16 22:23:07.861 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration adaptive_lighting 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-07-16 22:23:07.862 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration vesync 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-07-16 22:23:07.862 WARNING (SyncWorker_1) [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-07-16 22:23:36.816 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Bad' for ld2410_ble integration not ready yet: Could not find LD2410B device with address E6:E5:F7:FF:E3:BD; Retrying in background
2023-07-16 22:24:14.885 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: ld2410_ble
2023-07-16 22:29:43.253 WARNING (MainThread) [ld2410_ble.ld2410_ble] HLK-LD2410B_AF14: Device unexpectedly disconnected; RSSI: -61
2023-07-17 03:19:19.448 ERROR (MainThread) [homeassistant.components.hassio.handler] Timeout on /supervisor/stats request
2023-07-17 03:19:19.454 ERROR (MainThread) [homeassistant.components.hassio] Error fetching hassio data: Error on Supervisor API: 
2023-07-17 03:26:49.716 WARNING (SyncWorker_6) [pyvesync.vesync] Error retrieving device list
2023-07-17 03:48:07.435 ERROR (MainThread) [homeassistant.components.roborock.coordinator] Error fetching roborock data: Failed connecting to 192.168.178.35
2023-07-17 04:24:58.922 WARNING (MainThread) [aioesphomeapi.connection] esphome-web-cd9560-cd9560 @ 192.168.178.42: Connection error occurred: EOF received
2023-07-17 04:24:58.928 WARNING (MainThread) [ld2410_ble.ld2410_ble] HLK-LD2410B_6B77: Device unexpectedly disconnected; RSSI: -86
2023-07-17 04:24:58.939 WARNING (MainThread) [ld2410_ble.ld2410_ble] HLK-LD2410B_AF14: Device unexpectedly disconnected; RSSI: -61
2023-07-17 05:19:45.085 ERROR (MainThread) [homeassistant.components.nanoleaf] Error fetching Light Panels 52:47:BE data: 
2023-07-17 05:19:45.374 ERROR (MainThread) [homeassistant.components.roborock.coordinator] Error fetching roborock data: id=17057 Timeout after 4 seconds
2023-07-17 05:19:47.532 WARNING (MainThread) [roborock.api] [Errno 104] Connection reset by peer
2023-07-17 06:14:19.270 WARNING (MainThread) [roborock.api] [Errno 104] Connection reset by peer
2023-07-17 06:14:23.376 ERROR (MainThread) [homeassistant.components.roborock.coordinator] Error fetching roborock data: Failed connecting to 192.168.178.35
2023-07-17 06:14:54.086 ERROR (MainThread) [homeassistant.components.nanoleaf] Error fetching Light Panels 52:47:BE data: 
sabeechen commented 1 year ago

The error you're seeing is probably buried in the supervisor logs. But they don't go back far enough to see what happened last time the addon hit it (07-17 06:11:10). Could you tell the addon to try to sync (Actions > Sync Now), wait a handful of seconds, and then post the contents of another bug report?

Recently many have gotten 500 errors when Home Assistant can't reach their NAS. If you use a NAS make sure thats working.

Adriankor commented 1 year ago

My NAS shutdown every night and the backups of homeassistant are made on daytime. Is ist possible for the add on to implement this feature without getting an error? Maybe some sync free time?

I tired to do an automation to shut down the Add on but then I get the error that more than one backups will be deleted, every day.

sabeechen commented 1 year ago

Sorry this took me a while to get back to you on, life's been busy for me lately. Could you create a new issue/bug report with the multiple backup error (Actions > Create a Bug Report (in the addon web-ui)? I hadn't intended for the addon to be used like this, but I'm not aware of a reason it shouldn't work.

Mark-HomeAssistantTC commented 10 months ago

WOL/Wake on LAN Feature would solve the problem. I would love to have this feature.

Today I use an automation: Wake up the nas every 14 days in the night, take a backup 15 minutes later. World aß well, but a WOL feature in the addon would be nice.

sabeechen commented 10 months ago

I try to keep the addons setting as simple as possible to handle the most common use cases. If you'd like a more complicated backup routine you can do whats described here and create your own automation schedule by calling Home Assistant's Create Full/Partial Backup service.