Database Errors - Recorder Purge sqlite

Hello all. Wondering how to go about cleaning this up? Ever since I updated to 115 I’m getting these 2 error in my logs, which seem related. I have no special config for recorder or database, just using default HA.

Error purging history: (sqlite3.DatabaseError) database disk image is malformed [SQL: DELETE FROM states WHERE states.last_updated < ?] [parameters: (‘2020-08-05 14:12:23.189851’,)] (Background on this error at: http://sqlalche.me/e/13/4xp6)
Logger: homeassistant.components.recorder.purge
Source: components/recorder/purge.py:101
First occurred: September 23, 2020, 4:12:00 AM (3 occurrences)
Last logged: 4:12:00 AM

Error executing query: (sqlite3.DatabaseError) database disk image is malformed [SQL: DELETE FROM states WHERE states.last_updated < ?] [parameters: (‘2020-08-05 14:12:23.189851’,)] (Background on this error at: http://sqlalche.me/e/13/4xp6)
Logger: homeassistant.components.recorder.util
Source: components/recorder/util.py:43
Integration: Recorder
First occurred: September 23, 2020, 4:12:00 AM (3 occurrences)
Last logged: 4:12:00 AM

Doesn’t seem to affect my instance’s performance, but it bothers my mild OCD. I’ve read that the solution could be to just delete the entire home-assistant_v2.db file using File Editor, and letting it get rebuilt on a reboot. Is this correct?

I should probably read up more on maria or something…

Thanks!

Deleting and restarting is the easy way, with the downside that you lose your history.

There’s some information on repairing the database in this topic if you want to hang on to your history:

Thanks. This worked. History gone, but not used for much anyhow… Hope this isn’t a regular occurrence (database corruption…)

Updates and backups seem to do this to the default db now and then. MariaDB addon running in its own container seems to be much more resilient, to updates at least.