Recorder, history and logbook -> invalid config on startup?

My HA sd card died at some stage, so I did a restore. Ever since I get this “Invalid config” in the UI on startup. The errors in the log are ->
2018-12-10 21:31:22 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (sqlite3.DatabaseError) database disk image is malformed [SQL: ‘CREATE INDEX ix_states_entity_id ON states (entity_id)’] (Background on this error at: http://sqlalche.me/e/4xp6)
2018-12-10 21:31:22 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (sqlite3.DatabaseError) database disk image is malformed [SQL: ‘CREATE INDEX ix_states_entity_id ON states (entity_id)’] (Background on this error at: http://sqlalche.me/e/4xp6) (retrying in 3 seconds)
2018-12-10 21:31:27 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (sqlite3.DatabaseError) database disk image is malformed [SQL: ‘CREATE INDEX ix_states_entity_id ON states (entity_id)’] (Background on this error at: http://sqlalche.me/e/4xp6)
2018-12-10 21:31:27 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (sqlite3.DatabaseError) database disk image is malformed [SQL: ‘CREATE INDEX ix_states_entity_id ON states (entity_id)’] (Background on this error at: http://sqlalche.me/e/4xp6) (retrying in 3 seconds)

Any help appreciated.

Shut down your home assistant instance.
Make a backup of your home assistant database, (home-assistant_v2.db) then delete it.
When you restart home assistant, it will create a new one.

Thanks so much, I’ll give it try.
Hmmm, interesting, so the db is just a reflection of configuration that can be rebuilt any time? I didn’t realize that, cheers

that worked for me !! thank you :slight_smile: