HA won't bootup properly after updating to 7.2023

Hi all,

Upgraded to HAOS 7.2023, and initially appeared to be a succesful upgrade. Noticed that my ESPHome devices were all down, and tried to determine the root cause. After trying to reboot the RPI4+ & SSD, I’m not stuck in a situation where not all of the integrations are completing to fully boot up. It’s been about 20+ minutes of trying to complete the bootup. I was thinking of restoring from Full Backup, but it’s also not responding.

In the Logs upon boot, noticed this error:

The system could not validate that the sqlite3 database at //config/home-assistant_v2.db was shutdown cleanly

Could this be the issue on why it’s not fully booting up?

You could try renaming the db file to something like home-assistant_v2.bak and see if that solves it.

Thanks for the quick reply. Was looking up the issue, and looks like worse case, I may need to delete the file? I’m wondering if this needs to be done in a shutdown state.

Renamed the db file, & HA became unresponsive. I had to do a hard reset on the RPI4+ to reboot.

Logs still show the same error:

The system could not validate that the sqlite3 database at //config/home-assistant_v2.db was shutdown cleanly

Are you sure you renamed correctly? Is there now two db files (the one you renamed and a new one)?

Tried again. It’s trying to boot up now, but now:

The system will rename the corrupt database file //config/home-assistant_v2.db to //config/home-assistant_v2.db.corrupt.2023-07-23T20:07:21.980161+00:00 in order to allow startup to proceed

So it seems your db is broken. Just delete it (you will lose history).

I’m fine with losing history as long as it can boot back up. So just delete the file then reboot?

Yes. Not sure if it will allow you to delete it while it is running though.

I’m connected via SMB. How can I shutdown and delete the file?

If it allowed you to rename it earlier that should be good enough (when it does not find a file with the name home-assistant_v2.db it will create a new fresh file). Can you verify how many db files you have at the moment?

This is what I see:

image

What’s the file size on the two top ones? And do you have a file called config/home-assistant_v2.db.corrupt.2023-07-23T20:07:21.980161+00:00?

After renaming it, and the issue persists, is this still a problem?

I don’t see the corrupt file either.

Seems it created a new db file as expected, very strange that it reports corruption. Do a full shutdown and try starting back up.

It’s booting back up after full shutdown, but looks like it’s still having trouble initializing the integrations.

What’s the best way to restore from backup? Feeling regret, and kicking myself on upgrading now, lol.

If you cannot restore directly from HA I would think the best way is to do a fresh re-install and then restore from backup.

Appreciate your help. Looks like I may have to do that.

I’m stuck yet again trying to restore from a fresh install, & totally stumped on how I could resolve.

Looks like multiple add-ons are failing to start upon boot. Here is the Supervisor logs:

Any ideas?

23-07-23 20:31:56 INFO (SyncWorker_4) [supervisor.docker.interface] Attaching to ghcr.io/hassio-addons/adguard/armv7 with version 4.8.10
23-07-23 20:31:57 INFO (SyncWorker_0) [supervisor.docker.addon] Starting Docker add-on ghcr.io/hassio-addons/adguard/armv7 with version 4.8.10
23-07-23 20:31:57 INFO (MainThread) [supervisor.addons.addon] Finished restore for add-on a0d7b954_adguard
23-07-23 20:31:57 INFO (MainThread) [supervisor.addons] Detect new Add-on after restore a0d7b954_adguard
23-07-23 20:31:57 ERROR (MainThread) [supervisor.addons.addon] Add-on a0d7b954_vscode is not available for this platform
23-07-23 20:31:57 WARNING (MainThread) [supervisor.backups.backup] Can't restore Add-on a0d7b954_vscode: Add-on a0d7b954_vscode is not available for this platform
23-07-23 20:31:57 INFO (MainThread) [supervisor.backups.manager] Restore 4c57dc0b wait for Home-Assistant
23-07-23 20:32:01 INFO (MainThread) [supervisor.api.middleware.security] /network/info access from a0d7b954_adguard
23-07-23 20:32:02 INFO (MainThread) [supervisor.api.middleware.security] /network/interface/eth0/info access from a0d7b954_adguard
23-07-23 20:32:02 INFO (MainThread) [supervisor.api.middleware.security] /network/interface/wlan0/info access from a0d7b954_adguard
23-07-23 20:32:03 INFO (MainThread) [supervisor.discovery] Sending discovery to Home Assistant adguard from a0d7b954_adguard
23-07-23 20:32:04 INFO (MainThread) [supervisor.discovery] Discovery f7618c17345648b381f541c2ff116c21 message ignore
23-07-23 20:33:57 WARNING (MainThread) [supervisor.addons.addon] Timeout while waiting for addon File editor to start, took more then 120 seconds
23-07-23 20:33:57 WARNING (MainThread) [supervisor.addons.addon] Timeout while waiting for addon Terminal & SSH to start, took more then 120 seconds
23-07-23 20:33:57 WARNING (MainThread) [supervisor.addons.addon] Timeout while waiting for addon Cloudflared to start, took more then 120 seconds
23-07-23 20:33:57 WARNING (MainThread) [supervisor.addons.addon] Timeout while waiting for addon Nginx Proxy Manager to start, took more then 120 seconds
23-07-23 20:33:57 WARNING (MainThread) [supervisor.addons.addon] Timeout while waiting for addon MariaDB to start, took more then 120 seconds
23-07-23 20:33:57 WARNING (MainThread) [supervisor.addons.addon] Timeout while waiting for addon Z-Wave JS to start, took more then 120 seconds
23-07-23 20:33:57 WARNING (MainThread) [supervisor.addons.addon] Timeout while waiting for addon TasmoAdmin to start, took more then 120 seconds
23-07-23 20:33:57 WARNING (MainThread) [supervisor.addons.addon] Timeout while waiting for addon Mosquitto broker to start, took more then 120 seconds
23-07-23 20:33:57 WARNING (MainThread) [supervisor.addons.addon] Timeout while waiting for addon Grafana to start, took more then 120 seconds
23-07-23 20:33:57 WARNING (MainThread) [supervisor.addons.addon] Timeout while waiting for addon RTSP Simple Server Add-on to start, took more then 120 seconds
23-07-23 20:33:57 WARNING (MainThread) [supervisor.addons.addon] Timeout while waiting for addon InfluxDB to start, took more then 120 seconds
23-07-23 20:33:57 WARNING (MainThread) [supervisor.addons.addon] Timeout while waiting for addon MQTT Explorer to start, took more then 120 seconds
23-07-23 20:33:57 WARNING (MainThread) [supervisor.addons.addon] Timeout while waiting for addon Samba share to start, took more then 120 seconds
23-07-23 20:33:57 WARNING (MainThread) [supervisor.addons.addon] Timeout while waiting for addon ESPHome to start, took more then 120 seconds
23-07-23 20:33:57 WARNING (MainThread) [supervisor.addons.addon] Timeout while waiting for addon Eufy Security Add-on to start, took more then 120 seconds
23-07-23 20:33:57 WARNING (MainThread) [supervisor.addons.addon] Timeout while waiting for addon AdGuard Home to start, took more then 120 seconds
23-07-23 20:33:57 INFO (MainThread) [supervisor.homeassistant.module] Update pulse/client.config: /data/tmp/homeassistant_pulse
23-07-23 20:33:58 INFO (SyncWorker_3) [supervisor.docker.homeassistant] Starting Home Assistant ghcr.io/home-assistant/raspberrypi4-homeassistant with version 2023.5.4
23-07-23 20:33:58 INFO (MainThread) [supervisor.homeassistant.core] Wait until Home Assistant is ready
23-07-23 20:34:07 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state CoreState.FREEZE
23-07-23 20:34:07 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
23-07-23 20:34:08 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API token
23-07-23 20:34:09 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/esphome/home-assistant-addon repository
23-07-23 20:34:09 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/hassio-addons/repository repository
23-07-23 20:34:09 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/home-assistant/addons repository
23-07-23 20:34:09 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/fuatakgun/eufy_security_addon repository
23-07-23 20:34:09 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/fuatakgun/rtsp_simple_server repository
23-07-23 20:34:09 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/brenner-tobias/ha-addons repository
23-07-23 20:34:09 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/adamoutler/Addons repository
23-07-23 20:34:09 INFO (MainThread) [supervisor.updater] Fetching update data from https://version.home-assistant.io/stable.json
23-07-23 20:34:11 ERROR (SyncWorker_5) [supervisor.utils.json] Can't read json from /data/addons/local/awtrix2/config.json: Expecting ',' delimiter: line 13 column 4 (char 278)
23-07-23 20:34:11 WARNING (SyncWorker_5) [supervisor.store.data] Can't read /data/addons/local/awtrix2/config.json from repository local
23-07-23 20:34:11 WARNING (SyncWorker_5) [supervisor.addons.validate] Add-on have full device access, and selective device access in the configuration. Please report this to the maintainer of DeskPi Pro Active Cooling
23-07-23 20:34:13 ERROR (SyncWorker_7) [supervisor.utils.json] Can't read json from /data/addons/local/awtrix2/config.json: Expecting ',' delimiter: line 13 column 4 (char 278)
23-07-23 20:34:13 WARNING (SyncWorker_7) [supervisor.store.data] Can't read /data/addons/local/awtrix2/config.json from repository local
23-07-23 20:34:13 WARNING (SyncWorker_7) [supervisor.addons.validate] Add-on have full device access, and selective device access in the configuration. Please report this to the maintainer of DeskPi Pro Active Cooling
23-07-23 20:34:13 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 185, in block_bad_requests
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 201, in system_validation
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 268, in token_validation
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 280, in core_proxy
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/utils.py", line 62, in wrap_api
    answer = await method(api, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/store.py", line 178, in store_info
    ATTR_ADDONS: [
                 ^
  File "/usr/src/supervisor/supervisor/api/store.py", line 179, in <listcomp>
    self._generate_addon_information(self.sys_addons.store[addon])
  File "/usr/src/supervisor/supervisor/api/store.py", line 114, in _generate_addon_information
    ATTR_ADVANCED: addon.advanced,
                   ^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/addons/model.py", line 227, in advanced
    return self.data[ATTR_ADVANCED]
           ^^^^^^^^^
  File "/usr/src/supervisor/supervisor/store/addon.py", line 19, in data
    return self.sys_store.data.addons[self.slug]
           ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'a0d7b954_tor'
23-07-23 20:34:14 INFO (MainThread) [supervisor.store] Loading add-ons from store: 87 all - 0 new - 0 remove
23-07-23 20:34:14 INFO (MainThread) [supervisor.store] Loading add-ons from store: 87 all - 0 new - 0 remove
23-07-23 20:35:26 INFO (MainThread) [supervisor.auth] Auth request from 'core_mosquitto' for 'MQTT'
23-07-23 20:35:26 INFO (MainThread) [supervisor.auth] Home Assistant not running, checking cache
23-07-23 20:36:17 INFO (MainThread) [supervisor.auth] Auth request from 'core_mosquitto' for 'mqttsuper'
23-07-23 20:36:17 INFO (MainThread) [supervisor.auth] Home Assistant not running, checking cache
23-07-23 20:40:42 INFO (MainThread) [supervisor.auth] Auth request from 'core_mosquitto' for 'MQTT'
23-07-23 20:40:42 INFO (MainThread) [supervisor.auth] Home Assistant not running, checking cache
23-07-23 20:41:44 INFO (MainThread) [supervisor.auth] Auth request from 'core_mosquitto' for 'mqttsuper'
23-07-23 20:41:44 INFO (MainThread) [supervisor.auth] Home Assistant not running, checking cache