Restoring snapshot doesn't do anything

Tags: #<Tag:0x00007fc3fa325b98> #<Tag:0x00007fc3fa325aa8>

I have been pulling out (what’s left of) my hair over the last few weeks trying to restore from a backup. Everything was working fine until one morning at the end of March when Home Assistant no longer responded. Luckily I’ve been using the Google Drive backup to take a full snapshot every three days.

Every time I attempt to restore from the snapshot, as soon as I click the “Restore” button, the screen shows “Restoring from Backup” for about one second and then just refreshes the onboarding page as if nothing happened.

Here’s what I have attempted (restoring from HA version 2021.3.3):

  • Flashed same SD card w/ Hassio 5.13 and attempted to restore on the same RPI 3
  • Flashed brand new SD card w/ Hassio 5.13 and attempted to restore on the same RPI 3
  • Flashed same SD card w/ Hassio 5.13 and attempted to restore on the different RPI 3
  • Flashed brand new SD card w/ Hassio 5.13 and attempted to restore on the different RPI 3
  • I’ve attempted all of these scenarios with four or five different backup .tar files each
  • Attempted clicking “Restore Everything” and “Restore Selected” (with everything checked)
  • And I’ve repeated all of these attempts with Hassio 5.12 just in case

After reading several similar posts on the forums, I’ve also tried waiting overnight to give the backup plenty of time to do its thing just in case the UI just wasn’t showing the work in progress. Still no luck.

I haven’t been able to access the log files because it’s a fresh HASSIO install and SSH and/or Samba Share have not been installed/restored.

Anyone have any ideas? I desperately want to restore and not start over.

So I moved forward by creating an account and completing the onboarding just so that I could access the log. Here are the error messages.

2021-04-10 14:20:13 WARNING (Recorder) [homeassistant.components.recorder.migration] Database is about to upgrade. Schema version: 13
2021-04-10 14:20:18 ERROR (MainThread) [homeassistant.config_entries] Error importing platform config_flow from integration hassio to set up hassio configuration entry: No module named 'homeassistant.components.hassio.config_flow'
2021-04-10 14:20:32 WARNING (MainThread) [homeassistant.components.webhook] Received message for unregistered webhook a22db625d25b446aa51842ae16b9b22843cd570c131c6f3562eba80af8b2c17e from 192.168.86.30
2021-04-10 14:23:41 WARNING (zeroconf-Engine-241) [zeroconf] Choked at offset 0 while unpacking b'\n\xba\x10\x00'
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/zeroconf/__init__.py", line 743, in __init__
self.read_header()
File "/usr/local/lib/python3.8/site-packages/zeroconf/__init__.py", line 780, in read_header
) = self.unpack(b'!6H')
File "/usr/local/lib/python3.8/site-packages/zeroconf/__init__.py", line 767, in unpack
info = struct.unpack(format_, self.data[self.offset : self.offset + length])
struct.error: unpack requires a buffer of 12 bytes

Any idea what I might be doing wrong?

After attempting a restore from the Snapshots view, only one warning and one error are shown. So it must be related to the following:

2021-04-12 14:57:44 WARNING (Recorder) [homeassistant.components.recorder.migration] Database is about to upgrade. Schema version: 13
2021-04-12 14:57:50 ERROR (MainThread) [homeassistant.config_entries] Error importing platform config_flow from integration hassio to set up hassio configuration entry: No module named 'homeassistant.components.hassio.config_flow'

I would try doing a restore, but uncheck the first checkbox - the option to restore Home Assistant itself (Core). 2021.4 included a database upgrade, and that may be related to your issue. If that works you could restart Home Assistant and let it auto-detect the newest version of Core available and perform the upgrade. You can also revert to any previous version of Core by running one of the following commands in the Terminal window:
ha core update --version=2021.3.1
ha core update --version=2021.3.2
ha core update --version=2021.3.3
ha core update --version=2021.3.4
ha core update --version=2021.4.1
ha core update --version=2021.4.2
ha core update --version=2021.4.3

Thanks for the suggestion! I tried it but had no luck. After running the terminal command to revert to 2021.3.3, upon reboot the onboarding page appears and refreshes in a constant loop. Very strange.

I’m wondering if this is a new bug introduced by the database upgrade in 2021.4. Perhaps restoring a snapshot from a previous version fails due to this.

Next I’ll try to find a way to get a clean install of 2021.3.3. Not sure how to go about that yet.

I’m back up and running, but it wasn’t pretty. After extracting the files in my snapshots, I noticed two problems. One, most of my configuration files (even configuration.yaml itself) were missing even though I was doing full snapshots. Two, the snapshots included and old, corrupt database file that I had just never deleted from the RPI. I’m thinking that might be the database conversion error, and of course not having all the .yaml files had to play a role as well.

I found an older snapshot that had all the missing files. I extracted them from the .tar file and then copied them over to the RPI using Samba Share after a clean install with the latest Home Assistant core. To my surprise, everything came up and just started working. :grinning: