-
-
Notifications
You must be signed in to change notification settings - Fork 31k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No repair/user notification when database corruption detected #113891
Comments
Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) recorder documentation |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
This is difficult to set up a test. As far as I know this issue is still open. |
I have the same issue every few weeks. So I have to recover the corrupt database and merge it with the new one. I see it every time on the Energy Dashboard. It is possible so separate the statistic tables from the main database? This will fix the problem if the corruption is not caused by the statistic tables. But is will be better, when home assistant tries to recover the whole database by itself, so it will no have to create a blank one. This should only happen, if the recover and/or a PRAGMA test after this will fail. |
… SQLite database is re-created due to a corrupt database file. Updated unit tests to check issue is created.
Hey @rct, I created a PR for this feature, however it was rejected because repairs/issues need to be actionable. Unfortunately a database corruption is not easily fixable so it would not be possible to implement this feature as it stands. Best, |
@rlaunch Thank you for your work on this. I find that sort of thinking quite frustrating -- "the enemy of the good". So it is clearly better to leave the user in the dark struggling to figure out why things aren't behaving as expected. I get the arguments for architectural purity and consistency. So would it be possible/acceptable to create a persistent notification to get the user's attention? |
Hey @rct , I think that makes sense, maybe fire an event off too to allow people to trigger automations off it if they need to. Best, |
I had some time today to make the changes mentioned, and have raised it as PR #131367 Best, |
The problem
When home assistant detects database corruption and restarts with a new database, the user isn't notified via a repair or other notification. The user might not be aware that this has occurred until they notice missing history or have a reason to check the home assistant log.
It's great that Home Assistant fixes itself and restarts, but a user might not be aware of a problem for an extended period of time. This seems more likely to be detected overnight when recorder is doing db maintenance such as auto purge.
What version of Home Assistant Core has the issue?
core-2024.2.5
What was the last working version of Home Assistant Core?
core-2024.2.5
What type of installation are you running?
Home Assistant OS
Integration causing the issue
recorder
Link to integration documentation on our website
https://www.home-assistant.io/integrations/recorder/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response
The text was updated successfully, but these errors were encountered: