Hello,
I am using the default SQLite database for my Home Assistant setup (VM running in Proxmox) which is about 2.5gb in size. After updating from 2024.10.4 to 2024.11.0 I got the database update in progess message: “Database upgrade is in progress, Home Assistant will not start until the upgrade is completed.
The upgrade may need a long time to complete, please be patient.”
I left the server running over night but still had the message showing the next morning so I reverted back to my previous daily backup and am running 2024.10.4 again without problems.
After the 2024.11.1 release I tried updating again with a fresh database and was successfull.
After the update I added my database again and restarted. Now the message appears again. I will let this running in a new VM to see whether it can fix itself but with the fairly small db of 2.5gb running on a i3 8100 I would not expect the upgrade to take too long.
Are there any ways I can monitor the progress of the SQLite database upgrade? Why would the default SQLite db need a upgrade in the first place? I am a bit confsed since no one else seems to have this problem and I wolud like to not loose any of my statistics.
Thanks in advance,
Nico
Edit: These are the errors I get in home-assistant.log:
2024-11-09 10:29:54.098 WARNING (Recorder) [homeassistant.components.recorder.util] The system could not validate that the sqlite3 database at //config/home-assistant_v2.db was shutdown cleanly
2024-11-09 10:29:54.194 ERROR (Recorder) [homeassistant.helpers.recorder] Error executing query
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/recorder.py", line 101, in session_scope
yield session
File "/usr/src/homeassistant/homeassistant/components/recorder/migration.py", line 2426, in migrate_data_impl
"context_id_bin": _to_bytes(context_id)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/recorder/migration.py", line 2178, in _context_id_to_bytes
return UUID(context_id).bytes
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/uuid.py", line 175, in __init__
hex = hex.replace('urn:', '').replace('uuid:', '')
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: a bytes-like object is required, not 'str'
2024-11-09 10:29:54.199 ERROR (Recorder) [homeassistant.components.recorder.core] Recorder._run threw unexpected exception, recorder shutting down
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 677, in run
self._run()
File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 743, in _run
migration.migrate_data_non_live(self, self.get_session, schema_status)
File "/usr/src/homeassistant/homeassistant/components/recorder/migration.py", line 410, in migrate_data_non_live
migrator.migrate_all(instance, session_maker)
File "/usr/src/homeassistant/homeassistant/components/recorder/migration.py", line 2359, in migrate_all
while not self.migrate_data(instance):
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 763, in wrapper
return job(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/recorder/migration.py", line 2365, in migrate_data
return self._migrate_data(instance)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/recorder/migration.py", line 2295, in _migrate_data
status = self.migrate_data_impl(instance)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/recorder/migration.py", line 2426, in migrate_data_impl
"context_id_bin": _to_bytes(context_id)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/recorder/migration.py", line 2178, in _context_id_to_bytes
return UUID(context_id).bytes
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/uuid.py", line 175, in __init__
hex = hex.replace('urn:', '').replace('uuid:', '')
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: a bytes-like object is required, not 'str'
2024-11-09 10:29:54.204 ERROR (MainThread) [homeassistant.setup] Setup failed for 'recorder': Integration failed to initialize.
Update: 2024.12 is behaving the same way.