Guys, i encountered this error after upgrade HA. please help. I am new. many thanks!!
2021-02-11 23:48:30 WARNING (Recorder) [homeassistant.components.recorder.migration] Database is about to upgrade. Schema version: 9
2021-02-11 23:48:30 WARNING (Recorder) [homeassistant.components.recorder.migration] Adding index `ix_states_old_state_id` to database. Note: this can take several minutes on large databases and slow computers. Please be patient!
2021-02-11 23:48:30 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (sqlite3.DatabaseError) database disk image is malformed
[SQL: CREATE INDEX ix_states_old_state_id ON states (old_state_id)]
(Background on this error at: http://sqlalche.me/e/13/4xp6)
2021-02-11 23:48:30 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (sqlite3.DatabaseError) database disk image is malformed
[SQL: CREATE INDEX ix_states_old_state_id ON states (old_state_id)]
(Background on this error at: http://sqlalche.me/e/13/4xp6) (retrying in 3 seconds)
2021-02-11 23:48:42 WARNING (MainThread) [homeassistant.setup] Setup of recorder is taking over 10 seconds.