Now this 2023.9.3. update was a disaster for me. Tried to update as usual, but HA never came back up (cannot reach host). Power cycle didn’t help either. Now I am in the nightmare of restoring process, that just doesn’t want to work. I let it run for 12 hours without success and now trying again. I fear I need to build everything again and that is something I cannot even think after several years of HA use. I thought daily Google Backups would save me but doesn’t seem so…
2023.9.3 working fine for me too
Do you have large files included in the backup, such as an un-trimmed database or /media
audio or video?
Thankfully, HASS backups are just nested tar gzip archives so even if the full restore fails, you can unpack the backup and extract individual components and repack.
Add .tgz
to a backup file and use archive software to examine the contents.
Worst case, you can extract key config like automations.yaml
and manually restore.
There’s MariaDB & InfluxDB there as well, so backup file totals 1,9GB. But I have now started from scratch several times, and seems like I can restore individual things like addons from that Full Backup but it’s the HA backup itself inside there that always ends up in forever-going “err_connection_refused” error. I even tried to restore from partial backup that HA did just before it tried to update to 2023.9.3, but that ends up with the same error, HA never loads. I just don’t want to wait another 12 hours and see how nothing happens, it cannot take that long.
I also tried to copy manually what is inside that .tar file (configuration.yaml and everything else), but when I restart HA, it never reloads again. At some point yesterday I was able to reach the RP4 SSD though my network shares, and this is what was in home-assistant.log:
2023-09-25 19:46:50.637 ERROR (MainThread) [root] Uncaught exception
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/usr/src/homeassistant/homeassistant/__main__.py", line 216, in <module>
sys.exit(main())
^^^^^^
File "/usr/src/homeassistant/homeassistant/__main__.py", line 204, in main
exit_code = runner.run(runtime_conf)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/runner.py", line 186, in run
return loop.run_until_complete(setup_and_run_hass(runtime_config))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/runner.py", line 152, in setup_and_run_hass
hass = await bootstrap.async_setup_hass(runtime_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/bootstrap.py", line 144, in async_setup_hass
config_dict = await conf_util.async_hass_config_yaml(hass)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/config.py", line 401, in async_hass_config_yaml
await merge_packages_config(hass, config, core_config.get(CONF_PACKAGES, {}))
File "/usr/src/homeassistant/homeassistant/config.py", line 752, in merge_packages_config
PACKAGES_CONFIG_SCHEMA(packages)
File "/usr/src/homeassistant/homeassistant/helpers/config_validation.py", line 564, in verify
slug_validator(key)
File "/usr/src/homeassistant/homeassistant/helpers/config_validation.py", line 545, in slug
raise vol.Invalid(f"invalid slug {value} (try {slg})")
voluptuous.error.Invalid: invalid slug spot-price (try spot_price)
I guess the good thing is that I have all those yaml files etc backed up, but apparently there is no easy way to restore most of these things, which is too bad as there seems to be .json files etc inside those backup files that have all my configurations etc… Don’t know if for example I have to pair my 80+ zigbee devices again, I surely hope not!
Extract the homeassistant archive from your backup. Search all the files for “spot-price”. Replace it with “spot_price”. Then copy all the files over to your new config folder and start home assistant.
Is it just me or did the utility meters stop working?
Just you.
THANK YOU! I have no idea why my separate spot-price.yaml caused this trouble, changing that to spot_price.yaml and copying manually at least allowed my HA instance to reboot and things even look a bit like before. Lots of problems though:
Invalid config
The following integrations and platforms could not be set up:
- recorder (Show logs)
- filter.sensor (Show logs)
- history (Show logs)
- logbook (Show logs)
- energy (Show logs)
- default_config (Show logs)
Please check your config and logs.
Seems like I have a lot of figuring out to do, apparently all my addons are grey although their own log says they have been started… Those I restored from backup before I copied contents of homeassistant package manually.
All of those issues are likely because the recorder can’t be set up.
Are there database corruption errors in your logs?
Assuming you are using the default recorder database, you can try copying the home-assistant_v2.db file from one of your backups to the /config folder while home assistant is stopped.
If that does not work there are topics about database repair on the forum. Do a search.
I have MariaDB + InfluxDB. Seems like there is an error:
Error during connection setup: (MySQLdb.OperationalError) (2005, “Unknown server host ‘core-mariadb’ (-5)”)
Apparently I didn’t have MariaDB addon restored from backup, I am trying that now (partial restore) but since that package is about 1,2GB I wouldn’t be surprised if my HA would die again… At least nothing has happened yet, and it’s 30 minutes since I started the restoring process…
Also, for zigbee2mqtt, there is “addon.json” file in zigbee2mqtt backup package, and that file has quite a few configurations. Not sure where they are used because there’s also options.json file under data folder inside the same package, and that has the same configuration data as in zigbee2mqtt addon configuration (so at least that has been restored). But not sure where that addon.json should be stored…
Give it time! On a Pi4 I used to need around two, two and a half hours for restoring a 750MB backup… Restoring is a lot of writing on a disk or sd-card, and sd-cards aren’t the fastest… Always keep in mind, that writing to a disk takes always longer than reading!
But in general, I’d recommend to take a step back, and start anew. Repair the file name thingy in the full backup, and restore the full backup. That makes things easier, as you can see, you’re now producing new errors, that only arise because you’re not havening done the complete restore out of a partial backup. It’s kind of running around in circles…
I have my HA instance on RPI4 + SSD combo, so things should be relatively fast. Now seems like restore process did not freeze my HA but it didn’t do anything either. HA restart just left recorder errors etc.
I guess I could spend another night running full restore, although I hate when I cannot control lights etc… And I DID try that full restore yesterday, 12 hours and it still wasn’t done. So it didn’t even try to boot, if I understood right. Although starting completely from a new installation sounds good because I have had this setup for several years and naturally there are legacy code as well so things would be “more fresh” after that, there’s this HUGE amoung of work with tens of automations, almost 90 zigbee device pairing, losing ALL history… I thought I wouldn’t have to do that anymore since I do daily backups. But if those cannot be trusted, and (maybe?) only because of one wrong filename on one yaml file (which is also amazing since I have had that for months and HA has restarted just fine many times before, only 2023.9.3 update broke everything), it’s amazing that HA cannot just ignore it.
Anyway, I guess I could do what you suggest: I would repair the file name inside of that full backup package, then use balenaetcher once again and do full restore. Small hope, but on the other hand it seems amazing that full backup (although 1,9GB in size) was somehow completely broken…
Or just delete and reinstall the MariaDB addon. You’ll lose your history but the system will start.
and with php myadmin, you can import your old history pretty quickly.
Seems like MariaDB restore was succesful, after few restarts I still see 5 messages but when I click on them it says no messages Anyway, I think I try renaming that one yaml file inside that backup package, but even that is causing problems as in windows winRar is not able to write, just read tar.gz packages. Sheesh…
Yeah, found out after some digging that 7-zip can do it. However, it did a different package/folder structure compared to Home Assistant (HA backup shows ./file while 7-zip shows only file). And HA backup doesn’t recognize it. Anyway, I thought I would try to restore from a full backup from one day before, maybe that package works…
Wanted to tell that things are finally more or less okay for me. It seemed that a day older backup didn’t work either (as I noticed when I woke up when HA wasn’t up still), but then I realized that I can access samba share and see HA logs. Well, there was this same error message than before considering that one yaml file name, and I noticed that log had been updated about three hours after I started restoring from backup. So, since I had access to my hassio config folder, I just renamed the yaml file and then power cycled my HA. And ta-da - not much later I saw that HA was loading! And later I was also able to update to 2023.9.3. without issues.
So, although this ended okay for me, it still leaves a lot of questions about HA backup and restore process. First, we cannot see what is happening and have to sit and wait and hope that everything goes okay. Next (more worrying), if such thing as wrongly named yaml file that is by no means crucial for Home Assistant is causing so much problems that even restore from backup basically fails, but still that same wrongly named yaml doesn’t cause any issues when HA is running, and I could even restart HA just fine, then there should be some warnings at least on backup process itself.
One question remains that I have been wondering for a long time. Now I have two full days of missing history data, and two days where some hours are missing (today, and the day of my backup file as that is being done at 03:00). I would like to add solar production, power consumption etc for energy dashboard consistency, and I know I can add them via developer tools → statistics → fix problems, but that only works for those days I have at least some data on database. But how I could fix consumption etc for those two days that have no data at all on database?
Until you restart. Always do a config check after making updates to your configuration.
But that’s the thing: I did restart HA, several times in fact, and it didn’t stop HA from loading normally, despite of that yaml file. Also, this was a separate yaml file in packages-folder, so config check doesn’t notice those I think. And also nowadays HA even refuses to restart if there is a problem in configuration (noticed that few times) which is a good thing.