Database problem

I am having the following errors and no history is available for any entities:

Error saving events: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (sqlite3.DatabaseError) database disk image is malformed [SQL: INSERT INTO events (event_type, event_data, origin, time_fired, created, context_id, context_user_id, context_parent_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)] [parameters: ('state_changed', '{}', 'LOCAL', '2020-09-06 10:23:42.087985', '2020-09-06 10:23:42.096131', '0970f326f02b11eabf482f920f8bd410', None, None)] (Background on this error at: (Background on this error at:

I have restored from a backup and the same error.

I have tried deleting the db file and also no change.

has anyone a fix for this, please?

Normaly deleting the home-assistant_v2.db and restarting HA should fix it.
One cause i could think of if this doesn’t work could be filesystem errors on a dying SD card.

thank for the suggestions,

its running on a HDD, no errors when disk checked.

I deleted the database but did not fix it