Error executing query: (sqlite3.DatabaseError) database disk image is malformed

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: (‘service_registered’, ‘{“domain”: “recorder”, “service”: “purge”}’, ‘LOCAL’, ‘2019-01-24 06:22:12.197759’, ‘2019-01-24 06:27:45.017125’, ‘fc2569cefb7446d6aeb549a3f130402c’, None)] (Background on this error at: http://sqlalche.me/e/4xp6)

what does this mean? I am getting this in my logs…

The DB tends to corrupt from time to time, especially if you are using a Pi. The fix is just to delete the home-assistant_v2.db from the config directory and restart HA. You’ll lose your history, but it should fix the problem

5 Likes

@Mirai_Hayashi - Thank You had the same issue this fixed it.