Fresh install but all backups are some how "not a gzip file"

I have been happily using HA and Google backups but a recent update tanked my zigbee setup. Through escalating issues, it became clear my only recourse was to revert to a backup. I did so in the UI and it failed silently. (Side note, the restore process could really use some customer centric love)

Not until I got to the CLI and paid attention to the supervisor logs did I see that each time I tried a restore, HA could open the initial .tar file but threw and error on all the .tar.gz files it contains. HA got so bad that I had to start over.

Since a fresh install, I have tried 10 different backups going back 4 weeks and all of them have the same problem. I tried opening in 7zip (windows) and get the same issue so I can’t even manually restore.

Is there any recourse? (I don’t own a Linux computer)

Sample logs:

23-04-21 07:05:55 INFO (MainThread) [supervisor.backups.manager] Restoring 6667a2fe Docker config
23-04-21 07:05:55 INFO (MainThread) [supervisor.backups.manager] Restoring 6667a2fe folders
23-04-21 07:05:55 INFO (SyncWorker_3) [supervisor.backups.backup] Restore folder share
23-04-21 07:05:55 WARNING (SyncWorker_3) [supervisor.backups.backup] Can't restore folder share: not a gzip file
23-04-21 07:05:55 INFO (SyncWorker_7) [supervisor.backups.backup] Restore folder addons/local
23-04-21 07:05:55 WARNING (SyncWorker_7) [supervisor.backups.backup] Can't restore folder addons/local: not a gzip file
23-04-21 07:05:55 INFO (SyncWorker_4) [supervisor.backups.backup] Restore folder ssl
23-04-21 07:05:55 WARNING (SyncWorker_4) [supervisor.backups.backup] Can't restore folder ssl: not a gzip file
23-04-21 07:05:55 INFO (SyncWorker_6) [supervisor.backups.backup] Restore folder media
23-04-21 07:05:55 WARNING (SyncWorker_6) [supervisor.backups.backup] Can't restore folder media: not a gzip file
23-04-21 07:05:55 INFO (MainThread) [supervisor.backups.manager] Restoring 6667a2fe Home Assistant Core
23-04-21 07:05:55 ERROR (MainThread) [supervisor.homeassistant.module] Can't read tarfile <securetar.SecureTarFile object at 0x7f859a59f0>: not a gzip file
23-04-21 07:05:55 ERROR (MainThread) [supervisor.backups.manager] Restore 6667a2fe error

Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/homeassistant/module.py", line 372, in restore
    await self.sys_run_in_executor(_extract_tarfile)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/supervisor/supervisor/homeassistant/module.py", line 368, in _extract_tarfile
    with tar_file as backup:
  File "/usr/local/lib/python3.10/site-packages/securetar/__init__.py", line 92, in __enter__
    self._tar = tarfile.open(
  File "/usr/local/lib/python3.10/tarfile.py", line 1662, in open
    stream = _Stream(name, filemode, comptype, fileobj, bufsize)
  File "/usr/local/lib/python3.10/tarfile.py", line 371, in __init__
    self._init_read_gz()
  File "/usr/local/lib/python3.10/tarfile.py", line 478, in _init_read_gz
    raise ReadError("not a gzip file")
tarfile.ReadError: not a gzip file
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/backups/manager.py", line 270, in _do_restore
    task_hass = await backup.restore_homeassistant()
  File "/usr/src/supervisor/supervisor/backups/backup.py", line 502, in restore_homeassistant
    await self.sys_homeassistant.restore(homeassistant_file)
  File "/usr/src/supervisor/supervisor/homeassistant/module.py", line 374, in restore
    raise HomeAssistantError(
supervisor.exceptions.HomeAssistantError: Can't read tarfile <securetar.SecureTarFile object at 0x7f859a59f0>: not a gzip file

PS, sorry if I posted to the wrong channel. This seemed installation adjacent but happy to move somewhere else if more appropriate.

I found the error: I had a capitalization issue in my password.

At no point does the system attempt to validate the password. Instead decompression fails and the restore system thinks the file is corrupt. This just happens in the UI but you do get clues in the CLI.

Few suggestions to help restore:

  • store an unencrypted hash of the password so input can be validated. Return a friend error if they don’t match and halt the restore.
  • update CLI to include backups --slug to list all backups showing only:
    • date
    • size
    • full | partial
    • slug ID
  • progress indicator ( or anything ) to suggest a restore is working normally.

Got same issue and realized HA does not recognize wrong password on backup file.
If you try to restore password protected file with no password it generate error in log “wrong password”. But if you enter any password, than no “wrong password” error mesage is generated so you have no idea if the password is good or not.
It fixed by issue by random atemps of backup restore once i finaly try the good password and the backup was sucessfully restored.