Home assistant History Error (database)


I had this same issue this morning and the fix worked for me. Building upon the other instructions provided above.

To help everyone else here’s the steps i followed:

Install SSH server from addons and login over SSH or use web console

> ha core stop
> cd /config
> ls -al (this should show you a listing of all the files including home-assistant_v2.db

> sqlite3 ./home-assistant_v2.db ".dump" | sqlite3 ./home-assistant_v2.db.fix
> mv ./home-assistant_v2.db ./home-assistant_v2.db.broken
> mv ./home-assistant_v2.db.fix ./home-assistant_v2.db

> ha core start

Go back to main console, check logs and history via ui if fixed
Delete home-assistant_v2.db.broken

Hope that helps.

1 Like