FUBAR - History and Configurator gone - Database error


#1

I’m running Hassio on RPi3.
I am now unable to access my configurator and history files.
I am getting these database error messages:

Log Details (ERROR)

Sun Feb 10 2019 21:36:23 GMT-0600 (Central Standard Time)

Error executing query: (sqlite3.DatabaseError) database disk image is malformed [SQL: 'INSERT INTO states (domain, entity_id, state, attributes, event_id, last_changed, last_updated, created, context_id, context_user_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'] [parameters: ('sun', 'sun.sun', 'below_horizon', '{"next_dawn": "2019-02-11T12:48:02+00:00", "next_dusk": "2019-02-.........and it goes on until: http://sqlalche.me/e/4xp6)

and

Log Details (ERROR)

Sun Feb 10 2019 21:54:05 GMT-0600 (Central Standard Time)

Error executing query: (sqlite3.DatabaseError) database disk image is malformed [SQL: 'SELECT events.event_id AS events_event_id, events.event_type AS events_event_type, events.event_data AS events_event_data, events.origin AS events_origin, events.time_fired AS events_time_fired, events.created AS events_created, events.context_id AS events_context_id, events.context_user_id AS events_context_user_id \nFROM events LEFT OUTER JOIN states ON events.event_id = states.event_id \nWHERE events.event_type IN (?, ?, ?, ?, ?, ?, ?, ?) AND events.time_fired > ? AND events.time_fired < ? AND (states.last_updated = states.last_changed AND states.entity_id IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,........ and the error goes on until it says this: (Background on this error at: http://sqlalche.me/e/4xp6)

Any way to remedy this?
I am pretty non-technical, so if you have a good idea please explain in layman’s terms!


#2

Your database is corrupt. Delete it ( config/home-assistant_v2.db ) and restart HA. You will lose your history.


#3

Thanks. It fixed the history.