hassio-google-drive-backup
hassio-google-drive-backup copied to clipboard
Unable to import backup file into HA
Copy the info from the previous page here
Description:
If you have anything else that could help explain what happened, click "Markdown" above and write it here.
Addon version: 0.108.2
Home Assistant Version: 2022.6.7
Supervisor Version: 2022.05.3
Supervisor Channel: stable
Hassos Version: 8.2
Docker Version: 20.10.14
Architecture: amd64
Machine: qemux86-64
Date: 2022-06-28T12:33:30.328691+00:00
Timezone: Asia/Seoul
Failure Time: 2022-06-28T12:09:48.407069+00:00
Last Good Sync: 2022-06-28T12:09:59.448323+00:00
Exception:
No error could be identified automatically.
Backups:
{
"HomeAssistant": {
"backups": 0,
"retained": 0,
"deletable": 0,
"name": "HomeAssistant",
"title": "Home Assistant",
"latest": null,
"max": 4,
"enabled": true,
"icon": "home-assistant",
"ignored": 0,
"detail": "",
"size": "0.0 B",
"ignored_size": "0.0 B",
"free_space": "27.3 GB"
},
"GoogleDrive": {
"backups": 3,
"retained": 0,
"deletable": 3,
"name": "GoogleDrive",
"title": "Google Drive",
"latest": "2022-06-27T17:00:01Z",
"max": 4,
"enabled": true,
"icon": "google-drive",
"ignored": 0,
"detail": "[email protected]",
"size": "1.9 GB",
"ignored_size": "0.0 B"
}
}
Config:
{}
Addon Logs:
06-28 21:09:47 DEBUG [backup.drive.driverequests] Making Google Drive request: https://www.googleapis.com/drive/v3/about?fields=storageQuota%2Cuser
06-28 21:09:47 DEBUG [backup.drive.driverequests] Making Google Drive request: https://www.googleapis.com/drive/v3/files/?q=%271XppTsdlTE04NZ1_YVLOz6HfH84g-yvCj%27+in+parents&fields=nextPageToken%2Cfiles%28id%2Cname%2CappProperties%2Csize%2Ctrashed%2CmimeType%2CmodifiedTime%2Ccapabilities%2Cparents%2CdriveId%29&pageSize=100&supportsAllDrives=true&includeItemsFromAllDrives=true&corpora=allDrives
06-28 21:09:48 ERROR [backup.model.coordinator] A backup folder already exists. Please visit the add-on Web UI to select where to backup.
06-28 21:09:48 INFO [backup.model.coordinator] I'll try again in an hour
06-28 21:09:55 INFO [backup.model.coordinator] Syncing Backups
06-28 21:09:55 DEBUG [backup.ha.harequests] Making Hassio request: http://supervisor/supervisor/info
06-28 21:09:55 DEBUG [backup.ha.harequests] Making Hassio request: http://supervisor/backups
06-28 21:09:55 INFO [backup.drive.folderfinder] Saving backup folder: 1XppTsdlTE04NZ1_YVLOz6HfH84g-yvCj
06-28 21:09:55 DEBUG [backup.drive.driverequests] Making Google Drive request: https://www.googleapis.com/drive/v3/about?fields=storageQuota%2Cuser
06-28 21:09:56 DEBUG [backup.drive.driverequests] Making Google Drive request: https://www.googleapis.com/drive/v3/files/?q=%271XppTsdlTE04NZ1_YVLOz6HfH84g-yvCj%27+in+parents&fields=nextPageToken%2Cfiles%28id%2Cname%2CappProperties%2Csize%2Ctrashed%2CmimeType%2CmodifiedTime%2Ccapabilities%2Cparents%2CdriveId%29&pageSize=100&supportsAllDrives=true&includeItemsFromAllDrives=true&corpora=allDrives
06-28 21:09:59 DEBUG [backup.ha.harequests] Making Hassio request: http://supervisor/addons/self/options
06-28 21:09:59 DEBUG [backup.model.syncer] Sync requested by UI Server
06-28 21:09:59 INFO [backup.model.coordinator] Syncing Backups
06-28 21:09:59 DEBUG [backup.ha.harequests] Making Hassio request: http://supervisor/supervisor/info
06-28 21:09:59 DEBUG [backup.ha.harequests] Making Hassio request: http://supervisor/backups
06-28 21:09:59 DEBUG [backup.drive.driverequests] Making Google Drive request: https://www.googleapis.com/drive/v3/about?fields=storageQuota%2Cuser
06-28 21:09:59 DEBUG [backup.drive.driverequests] Making Google Drive request: https://www.googleapis.com/drive/v3/files/?q=%271XppTsdlTE04NZ1_YVLOz6HfH84g-yvCj%27+in+parents&fields=nextPageToken%2Cfiles%28id%2Cname%2CappProperties%2Csize%2Ctrashed%2CmimeType%2CmodifiedTime%2Ccapabilities%2Cparents%2CdriveId%29&pageSize=100&supportsAllDrives=true&includeItemsFromAllDrives=true&corpora=allDrives
06-28 21:10:25 INFO [backup.ha.hasource] Downloading 'Full Backup 2022-06-28'
06-28 21:10:25 DEBUG [backup.ha.harequests] Making Hassio request: http://supervisor/backups/new/upload
06-28 21:14:33 ERROR [backup.ha.hasource]
addon/backup/ha/hasource.py:362 (save)
addon/backup/ha/harequests.py:31 (wrap_and_call)
addon/backup/ha/harequests.py:89 (upload)
addon/backup/ha/harequests.py:245 (_postHassioData)
addon/backup/ha/harequests.py:31 (wrap_and_call)
addon/backup/ha/harequests.py:250 (_sendHassioData)
addon/backup/ha/harequests.py:202 (_validateHassioReply)
/site-packages/aiohttp/client_reqrep.py:1004 (raise_for_status)
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('http://supervisor/backups/new/upload')
06-28 21:20:01 INFO [backup.ha.hasource] Downloading 'Full Backup 2022-06-27'
06-28 21:20:02 DEBUG [backup.ha.harequests] Making Hassio request: http://supervisor/backups/new/upload
06-28 21:23:43 ERROR [backup.ha.hasource]
addon/backup/ha/hasource.py:362 (save)
addon/backup/ha/harequests.py:31 (wrap_and_call)
addon/backup/ha/harequests.py:89 (upload)
addon/backup/ha/harequests.py:245 (_postHassioData)
addon/backup/ha/harequests.py:31 (wrap_and_call)
addon/backup/ha/harequests.py:250 (_sendHassioData)
addon/backup/ha/harequests.py:202 (_validateHassioReply)
/site-packages/aiohttp/client_reqrep.py:1004 (raise_for_status)
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('http://supervisor/backups/new/upload')
06-28 21:24:06 INFO [backup.ha.hasource] Downloading 'Full Backup 2022-06-26'
06-28 21:24:06 DEBUG [backup.ha.harequests] Making Hassio request: http://supervisor/backups/new/upload
06-28 21:24:57 ERROR [backup.ha.hasource]
addon/backup/ha/hasource.py:362 (save)
addon/backup/ha/harequests.py:31 (wrap_and_call)
addon/backup/ha/harequests.py:89 (upload)
addon/backup/ha/harequests.py:245 (_postHassioData)
addon/backup/ha/harequests.py:31 (wrap_and_call)
addon/backup/ha/harequests.py:250 (_sendHassioData)
addon/backup/ha/harequests.py:202 (_validateHassioReply)
/site-packages/aiohttp/client_reqrep.py:1004 (raise_for_status)
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('http://supervisor/backups/new/upload')
06-28 21:25:23 DEBUG [backup.ha.harequests] Making Hassio request: http://supervisor/addons/self/info
06-28 21:25:23 DEBUG [backup.ha.harequests] Making Hassio request: http://supervisor/info
06-28 21:25:23 DEBUG [backup.ha.harequests] Making Hassio request: http://supervisor/core/info
06-28 21:25:23 DEBUG [backup.ha.harequests] Making Hassio request: http://supervisor/supervisor/info
Supervisor Logs:
[32m22-06-28 21:19:14 INFO (MainThread) [supervisor.backups.manager] Found 0 backup files[0m
[32m22-06-28 21:19:14 INFO (MainThread) [supervisor.backups.manager] Found 0 backup files[0m
[32m22-06-28 21:19:16 INFO (MainThread) [supervisor.backups.manager] Found 0 backup files[0m
[32m22-06-28 21:19:16 INFO (MainThread) [supervisor.backups.manager] Found 0 backup files[0m
[32m22-06-28 21:19:18 INFO (MainThread) [supervisor.backups.manager] Found 0 backup files[0m
[32m22-06-28 21:19:18 INFO (MainThread) [supervisor.backups.manager] Found 0 backup files[0m
[32m22-06-28 21:19:19 INFO (MainThread) [supervisor.backups.manager] Found 0 backup files[0m
[32m22-06-28 21:19:19 INFO (MainThread) [supervisor.backups.manager] Found 0 backup files[0m
[32m22-06-28 21:19:20 INFO (MainThread) [supervisor.backups.manager] Found 0 backup files[0m
[32m22-06-28 21:19:20 INFO (MainThread) [supervisor.backups.manager] Found 0 backup files[0m
[32m22-06-28 21:19:21 INFO (MainThread) [supervisor.backups.manager] Found 0 backup files[0m
[32m22-06-28 21:19:21 INFO (MainThread) [supervisor.backups.manager] Found 0 backup files[0m
[32m22-06-28 21:20:02 INFO (MainThread) [supervisor.api.middleware.security] /backups/new/upload access from cebe7a76_hassio_google_drive_backup[0m
[31m22-06-28 21:23:43 ERROR (MainThread) [supervisor.backups.backup] Can't validate data for /data/tmp/tmpvr8s5bwj/backup.tar: expected a URL @ data['repositories'][0]. Got 'core'
expected a URL @ data['repositories'][3]. Got 'local'[0m
[32m22-06-28 21:24:06 INFO (MainThread) [supervisor.api.middleware.security] /backups/new/upload access from cebe7a76_hassio_google_drive_backup[0m
[31m22-06-28 21:24:57 ERROR (MainThread) [supervisor.backups.backup] Can't validate data for /data/tmp/tmplhwymndz/backup.tar: expected a URL @ data['repositories'][0]. Got 'core'
expected a URL @ data['repositories'][3]. Got 'local'[0m
[32m22-06-28 21:25:23 INFO (MainThread) [supervisor.api.middleware.security] /core/info access from cebe7a76_hassio_google_drive_backup[0m
[32m22-06-28 21:25:23 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/info access from cebe7a76_hassio_google_drive_backup[0m
[32m22-06-28 21:27:13 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/logs access from cebe7a76_hassio_google_drive_backup[0m
[32m22-06-28 21:27:13 INFO (MainThread) [supervisor.api.middleware.security] /core/logs access from cebe7a76_hassio_google_drive_backup[0m
[32m22-06-28 21:31:44 INFO (MainThread) [supervisor.backups.manager] Found 0 backup files[0m
[32m22-06-28 21:31:44 INFO (MainThread) [supervisor.backups.manager] Found 0 backup files[0m
[32m22-06-28 21:32:39 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API token[0m
[31m22-06-28 21:32:55 ERROR (MainThread) [supervisor.backups.backup] Can't read backup tarfile /data/tmp/tmpa_qcevks/backup.tar: "filename './backup.json' not found"[0m
[32m22-06-28 21:33:02 INFO (MainThread) [supervisor.backups.manager] Found 0 backup files[0m
[32m22-06-28 21:33:02 INFO (MainThread) [supervisor.backups.manager] Found 0 backup files[0m
[32m22-06-28 21:33:30 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/logs access from cebe7a76_hassio_google_drive_backup[0m
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
It looks like Home Assistant is having trouble reading this backup file. You can tell from this line in the supervisor logs:
[31m22-06-28 21:24:57 ERROR (MainThread) [supervisor.backups.backup] Can't validate data for /data/tmp/tmplhwymndz/backup.tar: expected a URL @ data['repositories'][0]. Got 'core' expected a URL @ data['repositories'][3]. Got 'local'
Inside the backup is a json file with the backup's metadata called either backup.json or snapshot.json. This error from the supervisor indicates that the format of that metadata file is invalid (here is where the error is thrown in the supervisor, for reference).
While I'm not a supervisor developer, I would speculate this could happen if:
- The backup is very old and isn't in a supported format anymore.
- The backup is corrupted (very unlikely given the error you're seeing)
- The supervisor has a bug that isn't interpreting the backup correctly.
As a reminder this addon doesn't actually create or restore backups, it just asks Home Assistant to do so and then copys the file to/from Google Drive. This problem is in Home Assistant.
If I were you I would open up the backup using something like 7zip and look at the backup.json file. You might be able to remove the problematic parts of the configuration (the list called 'repositories' in this case) then recompress the backup.json and attempt to upload it into Home Assistant again. You may also want to consider creating an issue in the supervisor's issue tracker if your able to get some evidence that this indeed a bug in the supervisor.
I have the exact same issue as the issue starter.
My backup file is 2gb and when restoring it from G-drive to Hass host, it fails as it is about to finish, resulting in the error seen in the logs of the issue starter. (identic error message).
My file is only 7 days old, from the 28th of june, so the first theory of old files does not apply. And the backup seems to be OK, as i can extract the archive.
Also, as a side note, i uploaded the files to /backups manually with the samba share connection, and the backups/Google drive backup does not even recognize that the tar-archive is in the folder. Even if i re-sync and restart the host. It still says "Drive only", indicating that it only exists in Google drive, and not on the Hass host, even if its not true.
I'm pretty sure this is an issue in Home Assistant's Supervisor. There isnt anything I can do about it in the addon. This addon only copies around the data Home Assistant creates for it.
Although that bug is closed I'm not sure if the issue is resolved, it looks like Home Assistant is making backups that it can't read back in. The creator of that bug resolved the issue for himself by modifying the backup.json file inside the backup and removing the 'local' item from the list of repositories. that seems like it would work but its cumbersome.
Please feel free to reopen this if you think there is more I can help with.