Experiencing the same issue after SD card snapshot restore:
Error executing query: (sqlite3.DatabaseError) database disk image is malformed
[SQL: INSERT INTO events (event_type, event_data, origin, time_fired, created, context_id, context_user_id) VALUES (?, ?, ?, ?, ?, ?, ?)]
[parameters: ('state_changed', '{"entity_id": "sensor.power_consumption_phase_l2", "old_state": {"entity_id": "sensor.power_consumption_phase_l2", "state": "1.949", "attributes": {" ... (534 characters truncated) ... :00", "last_updated": "2019-06-14T07:47:40.495309+00:00", "context": {"id": "0d0214ec3fdb4f1db157e5f81379d396", "parent_id": null, "user_id": null}}}', 'LOCAL', '2019-06-14 07:47:40.495385', '2019-06-14 07:47:40.587635', '0d0214ec3fdb4f1db157e5f81379d396', None)]
(Background on this error at: http://sqlalche.me/e/4xp6)
As I understand correctly, deleting home-assistant_v2.db will lose my history?
Is there no way to repair the home-assistant_v2.db file and preserve my history data?
tx a lot 