I’ve been searching the forums and yet to find something to help.
In short, my SQLITE db is never able to be created. Every fresh restart, after clearing all corrupt .db files and the current .db file, always creates a new blank file and a bunch of corrupted ones.
The first error shown is 2024-12-23 13:23:01.282 ERROR (Recorder) [homeassistant.components.recorder.core] Error during connection setup: (retrying in 3 seconds)
Followed by the db is locked. sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked
2024-12-23 13:23:04.349 ERROR (Recorder) [homeassistant.components.recorder.util] The database at //config/home-assistant_v2.db is corrupt or malformed
sqlite3.OperationalError: no such table: states
2024-12-23 13:23:04.353 ERROR (Recorder) [homeassistant.components.recorder.util] The system will rename the corrupt database file //config/home-assistant_v2.db to //config/home-assistant_v2.db.corrupt.2024-12-23T13:23:04.353189+00:00 in order to allow startup to proceed
I have no data currently to ingest into the db. I just need a blank fresh working db.
All the current guidance is to clear the files and fresh restart but this always results in the same log output errors. Is there something else I need to do to get this to work?
What kind of installation do you use? If HA in container - stop the HA container, delete db-files, start HA container.
Also, comment your “recorder” settings (if not default).
Also, start HA in a safe mode.
Grasping at straws but might it be that you have accessed the db from another tool and that one is still running? What docker command did you run to create the lot. As @Ildar_Gabdullin says, delete all config and restart?
Let me try that. As it is a container, there is no fresh install really. But I can run a clean container with no previous configs and see if I can get the db files that way.