Notification when database is corrupt

It would be nice if it was possible to send notifications via the app and e-mail when a new database is intiated and the current one is copied and marked as ‘corrupt’.

I’ve experienced this today. I was missing all my history and started investigating. After a while I found out the database got corrupt (but the system was still/again running).

It would be nice to send an e-mail and a push message since the faster you can address this, the less data is written to the new (kind of) useless database.

In my opinion, you could even make the frontend unavailable or add a very clear message that there has been created a new database. I’m kind of surprised by the fresh database without getting any notification.

Since HA is advising people to not use mariadb or any other external database, it would be nice to be informed about those drastic actions.

I’ve faced the same issue, was extremely frustrating.

Luckily, I found missing historical data on the same day, so I lost only a few hours. But it could get much worse. I heavily rely on historical data to optimize energy consumption.

To make things worse, this time, the database file itself was okay—just some random inconsistency in the data. But I don’t have logs anymore. I expect this accident is not the last one; my DB is ~10GB big.

sqlite3 home-assistant_v2.db.corrupt.2024-07-10T01:12:07.734425+00:00 'pragma integrity_check;'
ok

It is better to make :white_check_mark: checkbox for such notification