bdraco
(J. Nick Koston)
July 17, 2024, 1:15pm
122
2024.7.3 which is currently scheduled for the end of the week will better handle low resource systems.
Make sure you have at least as much free disk space available as the size of your database at all times. This is general advice not specific to the table rebuild.
For the table rebuild it is preferred to have 2.5x the size of your database available in the event your system previously experienced an unclean shutdown (ie power loss, bad power supply, bad sd card, other hardware failure) which corrupted the states table in the past, and the corruption is only encountered during the table rebuild.
1 Like
VanFlipsen
(Van Flipsen)
July 17, 2024, 6:41pm
123
I have same issues regarding the purge at 4;something even running 2024.7.2.
This morning recorder was not functioning, changes like window sensors are not noticed/recorded by home assistant, my rolling shutters where closing against an open window. Now i have to repair 1 of my rolling shutters.
Another issue with my database lies on energy dashboard (LTS?) in 10 september 2023, cannot access data that Day/Week/Q3/Year I dont know how to fix that. maybe that is a issue causing the trouble with purging.
thanks, I’ve tried that, but it looks like it doesn’t even start to rebuild
RezzZ
(ReneS)
July 18, 2024, 9:42am
125
also here problems with 2024.7+, recorder is stuck.
Running HA for years (unraid server, HA docker, MariaDB v11 latest docker.
Solution 1 to disable autopurge doest prevent recorder to break in my setup and because history is not available any more some automations won’t run.
For now I’ve reverted back (as suggested) to 2024.6.4 and all has been stable for 2 days now.
I’m not running any of the other custom integrations mentioned in issue 2. Happy to provide additional info if required (for the next 2 days till I go on holiday )
My custom integrations from HACS:
Homewizard Climate
Daily Schedule
Switch Manager
Electrolux Care Integration V2 (Not Official)
nordpool
simpleicons
midea air appliances (LAN)
Tuya Local
Neerslag App
edit: hmm reverting back seems to have broken al lot of other pages seems…
my developer tools settings pages now all show “Error while loading page” oops
I’ve restored a backup from 9 days ago, when I didn’t have this issue.
It was 2024.7.1, I’ve updated to 2024.7.2, after reboot it started to rebuild the DB.
I hope it will solve the issue. I’ve lost 9 days history, but I couldn’t make it rebuild any newer DB I had.
edit: it works now
bdraco
(J. Nick Koston)
July 19, 2024, 10:29pm
127
Two of the changes were released today in 2024.7.3
home-assistant:dev
← home-assistant:narrow_malformed_check
opened 04:52PM - 14 Jul 24 UTC
## Proposed change
<!--
Describe the big picture of your changes here to com… municate to the
maintainers why we should accept this pull request. If it fixes a bug
or resolves a feature request, be sure to link to that issue in the
additional information section.
-->
The database corruption check would also replace the database when it locked externally instead of only when its malformed.
This was discovered in https://github.com/home-assistant/core/issues/121909#issuecomment-2227409124 when a user externally did a manual index creation while HA was online which held the lock on the database.
## Type of change
<!--
What type of change does your PR introduce to Home Assistant?
NOTE: Please, check only 1! box!
If your PR requires multiple boxes to be checked, you'll most likely need to
split it into multiple PRs. This makes things easier and faster to code review.
-->
- [ ] Dependency upgrade
- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] New integration (thank you!)
- [ ] New feature (which adds functionality to an existing integration)
- [ ] Deprecation (breaking change to happen in the future)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code or addition of tests
## Additional information
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- This PR fixes or closes issue: fixes #
- This PR is related to issue:
- Link to documentation pull request:
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [x] The code change is tested and works locally.
- [ ] Local tests pass. **Your PR cannot be merged unless tests pass**
- [ ] There is no commented out code in this PR.
- [ ] I have followed the [development checklist][dev-checklist]
- [ ] I have followed the [perfect PR recommendations][perfect-pr]
- [ ] The code has been formatted using Ruff (`ruff format homeassistant tests`)
- [x] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated for [www.home-assistant.io][docs-repository]
If the code communicates with devices, web services, or third-party tools:
- [ ] The [manifest file][manifest-docs] has all fields filled out correctly.
Updated and included derived files by running: `python3 -m script.hassfest`.
- [ ] New or updated dependencies have been added to `requirements_all.txt`.
Updated by running `python3 -m script.gen_requirements_all`.
- [ ] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
<!--
This project is very active and we have a high turnover of pull requests.
Unfortunately, the number of incoming pull requests is higher than what our
reviewers can review and merge so there is a long backlog of pull requests
waiting for review. You can help here!
By reviewing another pull request, you will help raise the code quality of
that pull request and the final review will be faster. This way the general
pace of pull request reviews will go up and your wait time will go down.
When picking a pull request to review, try to choose one that hasn't yet
been reviewed.
Thanks for helping out!
-->
To help with the load of incoming pull requests:
- [ ] I have reviewed two other [open pull requests][prs] in this repository.
[prs]: https://github.com/home-assistant/core/pulls?q=is%3Aopen+is%3Apr+-author%3A%40me+-draft%3Atrue+-label%3Awaiting-for-upstream+sort%3Acreated-desc+review%3Anone+-status%3Afailure
<!--
Thank you for contributing <3
Below, some useful links you could explore:
-->
[dev-checklist]: https://developers.home-assistant.io/docs/development_checklist/
[manifest-docs]: https://developers.home-assistant.io/docs/creating_integration_manifest/
[quality-scale]: https://developers.home-assistant.io/docs/integration_quality_scale_index/
[docs-repository]: https://github.com/home-assistant/home-assistant.io
[perfect-pr]: https://developers.home-assistant.io/docs/review-process/#creating-the-perfect-pr
home-assistant:dev
← home-assistant:log_index_ops_complete
opened 12:12PM - 12 Jul 24 UTC
## Proposed change
<!--
Describe the big picture of your changes here to com… municate to the
maintainers why we should accept this pull request. If it fixes a bug
or resolves a feature request, be sure to link to that issue in the
additional information section.
-->
This problem keeps coming up every time we do a migration .. https://ptb.discord.com/channels/330944238910963714/332167321311510530/1261295954565271563
When an index operation during a migration starts, we log at a warning level to ensure the message always appears in the log. When the index operation was completed, we logged at the debug level, which was confusing because the completion would only be seen if the logging level was debug. This led to confusion because there was no way to tell if the index operation was complete when the logging level was lower than debug.
## Type of change
<!--
What type of change does your PR introduce to Home Assistant?
NOTE: Please, check only 1! box!
If your PR requires multiple boxes to be checked, you'll most likely need to
split it into multiple PRs. This makes things easier and faster to code review.
-->
- [ ] Dependency upgrade
- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] New integration (thank you!)
- [ ] New feature (which adds functionality to an existing integration)
- [ ] Deprecation (breaking change to happen in the future)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code or addition of tests
## Additional information
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- This PR fixes or closes issue: fixes #
- This PR is related to issue:
- Link to documentation pull request:
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [x] The code change is tested and works locally.
- [ ] Local tests pass. **Your PR cannot be merged unless tests pass**
- [ ] There is no commented out code in this PR.
- [ ] I have followed the [development checklist][dev-checklist]
- [ ] I have followed the [perfect PR recommendations][perfect-pr]
- [ ] The code has been formatted using Ruff (`ruff format homeassistant tests`)
- [ ] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated for [www.home-assistant.io][docs-repository]
If the code communicates with devices, web services, or third-party tools:
- [ ] The [manifest file][manifest-docs] has all fields filled out correctly.
Updated and included derived files by running: `python3 -m script.hassfest`.
- [ ] New or updated dependencies have been added to `requirements_all.txt`.
Updated by running `python3 -m script.gen_requirements_all`.
- [ ] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
<!--
This project is very active and we have a high turnover of pull requests.
Unfortunately, the number of incoming pull requests is higher than what our
reviewers can review and merge so there is a long backlog of pull requests
waiting for review. You can help here!
By reviewing another pull request, you will help raise the code quality of
that pull request and the final review will be faster. This way the general
pace of pull request reviews will go up and your wait time will go down.
When picking a pull request to review, try to choose one that hasn't yet
been reviewed.
Thanks for helping out!
-->
To help with the load of incoming pull requests:
- [ ] I have reviewed two other [open pull requests][prs] in this repository.
[prs]: https://github.com/home-assistant/core/pulls?q=is%3Aopen+is%3Apr+-author%3A%40me+-draft%3Atrue+-label%3Awaiting-for-upstream+sort%3Acreated-desc+review%3Anone+-status%3Afailure
<!--
Thank you for contributing <3
Below, some useful links you could explore:
-->
[dev-checklist]: https://developers.home-assistant.io/docs/development_checklist/
[manifest-docs]: https://developers.home-assistant.io/docs/creating_integration_manifest/
[quality-scale]: https://developers.home-assistant.io/docs/integration_quality_scale_index/
[docs-repository]: https://github.com/home-assistant/home-assistant.io
[perfect-pr]: https://developers.home-assistant.io/docs/review-process/#creating-the-perfect-pr
The remaining two will be in 2024.8.0
home-assistant:dev
← home-assistant:fix_migration_queue_max_size
opened 11:16PM - 10 Jul 24 UTC
## Proposed change
<!--
Describe the big picture of your changes here to com… municate to the
maintainers why we should accept this pull request. If it fixes a bug
or resolves a feature request, be sure to link to that issue in the
additional information section.
-->
The calculation should not have counted the current queue when considering the available ram because the available ram already considers the current queue in memory. This lead to the maximum queue size being smaller than expected and the recorder giving up too soon on queuing events during a migration or table rebuild.
This only matters for memory constrained systems since there would still be more than enough ram for the calculation to be high enough to finish in time with the old logic.
https://github.com/home-assistant/core/issues/121614#issuecomment-2221654173
## Type of change
<!--
What type of change does your PR introduce to Home Assistant?
NOTE: Please, check only 1! box!
If your PR requires multiple boxes to be checked, you'll most likely need to
split it into multiple PRs. This makes things easier and faster to code review.
-->
- [ ] Dependency upgrade
- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] New integration (thank you!)
- [ ] New feature (which adds functionality to an existing integration)
- [ ] Deprecation (breaking change to happen in the future)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code or addition of tests
## Additional information
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- This PR fixes or closes issue: fixes #
- This PR is related to issue:
- Link to documentation pull request:
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [x] The code change is tested and works locally.
- [ ] Local tests pass. **Your PR cannot be merged unless tests pass**
- [ ] There is no commented out code in this PR.
- [ ] I have followed the [development checklist][dev-checklist]
- [ ] I have followed the [perfect PR recommendations][perfect-pr]
- [ ] The code has been formatted using Ruff (`ruff format homeassistant tests`)
- [x] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated for [www.home-assistant.io][docs-repository]
If the code communicates with devices, web services, or third-party tools:
- [ ] The [manifest file][manifest-docs] has all fields filled out correctly.
Updated and included derived files by running: `python3 -m script.hassfest`.
- [ ] New or updated dependencies have been added to `requirements_all.txt`.
Updated by running `python3 -m script.gen_requirements_all`.
- [ ] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
<!--
This project is very active and we have a high turnover of pull requests.
Unfortunately, the number of incoming pull requests is higher than what our
reviewers can review and merge so there is a long backlog of pull requests
waiting for review. You can help here!
By reviewing another pull request, you will help raise the code quality of
that pull request and the final review will be faster. This way the general
pace of pull request reviews will go up and your wait time will go down.
When picking a pull request to review, try to choose one that hasn't yet
been reviewed.
Thanks for helping out!
-->
To help with the load of incoming pull requests:
- [ ] I have reviewed two other [open pull requests][prs] in this repository.
[prs]: https://github.com/home-assistant/core/pulls?q=is%3Aopen+is%3Apr+-author%3A%40me+-draft%3Atrue+-label%3Awaiting-for-upstream+sort%3Acreated-desc+review%3Anone+-status%3Afailure
<!--
Thank you for contributing <3
Below, some useful links you could explore:
-->
[dev-checklist]: https://developers.home-assistant.io/docs/development_checklist/
[manifest-docs]: https://developers.home-assistant.io/docs/creating_integration_manifest/
[quality-scale]: https://developers.home-assistant.io/docs/integration_quality_scale_index/
[docs-repository]: https://github.com/home-assistant/home-assistant.io
[perfect-pr]: https://developers.home-assistant.io/docs/review-process/#creating-the-perfect-pr
home-assistant:dev
← home-assistant:no_fk
opened 01:01PM - 14 Jul 24 UTC
## Proposed change
<!--
Describe the big picture of your changes here to com… municate to the
maintainers why we should accept this pull request. If it fixes a bug
or resolves a feature request, be sure to link to that issue in the
additional information section.
-->
If `ix_states_event_id` index was removed but the foreign key still exists, the states table would not get rebuilt. This should not happen under normal circumstances but can if:
- The index was removed manually
- Home Assistant was restarted forcefully in the middle of a previous migration from years ago
- The system ran out of disk space during a previous migration
## Type of change
<!--
What type of change does your PR introduce to Home Assistant?
NOTE: Please, check only 1! box!
If your PR requires multiple boxes to be checked, you'll most likely need to
split it into multiple PRs. This makes things easier and faster to code review.
-->
- [ ] Dependency upgrade
- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] New integration (thank you!)
- [ ] New feature (which adds functionality to an existing integration)
- [ ] Deprecation (breaking change to happen in the future)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code or addition of tests
## Additional information
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- This PR fixes or closes issue: fixes #121909
- This PR is related to issue:
- Link to documentation pull request:
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [x] The code change is tested and works locally.
- [ ] Local tests pass. **Your PR cannot be merged unless tests pass**
- [ ] There is no commented out code in this PR.
- [ ] I have followed the [development checklist][dev-checklist]
- [ ] I have followed the [perfect PR recommendations][perfect-pr]
- [ ] The code has been formatted using Ruff (`ruff format homeassistant tests`)
- [x] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated for [www.home-assistant.io][docs-repository]
If the code communicates with devices, web services, or third-party tools:
- [ ] The [manifest file][manifest-docs] has all fields filled out correctly.
Updated and included derived files by running: `python3 -m script.hassfest`.
- [ ] New or updated dependencies have been added to `requirements_all.txt`.
Updated by running `python3 -m script.gen_requirements_all`.
- [ ] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
<!--
This project is very active and we have a high turnover of pull requests.
Unfortunately, the number of incoming pull requests is higher than what our
reviewers can review and merge so there is a long backlog of pull requests
waiting for review. You can help here!
By reviewing another pull request, you will help raise the code quality of
that pull request and the final review will be faster. This way the general
pace of pull request reviews will go up and your wait time will go down.
When picking a pull request to review, try to choose one that hasn't yet
been reviewed.
Thanks for helping out!
-->
To help with the load of incoming pull requests:
- [ ] I have reviewed two other [open pull requests][prs] in this repository.
[prs]: https://github.com/home-assistant/core/pulls?q=is%3Aopen+is%3Apr+-author%3A%40me+-draft%3Atrue+-label%3Awaiting-for-upstream+sort%3Acreated-desc+review%3Anone+-status%3Afailure
<!--
Thank you for contributing <3
Below, some useful links you could explore:
-->
[dev-checklist]: https://developers.home-assistant.io/docs/development_checklist/
[manifest-docs]: https://developers.home-assistant.io/docs/creating_integration_manifest/
[quality-scale]: https://developers.home-assistant.io/docs/integration_quality_scale_index/
[docs-repository]: https://github.com/home-assistant/home-assistant.io
[perfect-pr]: https://developers.home-assistant.io/docs/review-process/#creating-the-perfect-pr
6 Likes
sebazzz
(Sebazzz)
July 20, 2024, 11:07am
128
I also have the issue in 2024.7.2:
# sqlite3 home-assistant_v2.db
SQLite version 3.44.2 2023-11-24 11:41:44
Enter ".help" for usage hints.
sqlite> .schema event_data
CREATE TABLE event_data (
data_id INTEGER NOT NULL,
hash BIGINT,
shared_data TEXT,
PRIMARY KEY (data_id)
);
CREATE INDEX ix_event_data_hash ON event_data (hash);
sqlite> .schema events
CREATE TABLE events (
event_id INTEGER NOT NULL,
event_type VARCHAR(64),
event_data TEXT,
origin VARCHAR(32),
time_fired DATETIME,
created DATETIME,
context_id VARCHAR(36),
context_user_id VARCHAR(36),
context_parent_id VARCHAR(36), data_id INTEGER, origin_idx INTEGER, time_fired_ts FLOAT, context_id_bin BLOB, context_user_id_bin BLOB, context_parent_id_bin BLOB, event_type_id INTEGER,
PRIMARY KEY (event_id)
);
CREATE INDEX ix_events_data_id ON events (data_id);
CREATE INDEX ix_events_time_fired_ts ON events (time_fired_ts);
CREATE INDEX ix_events_context_id_bin ON events (context_id_bin);
CREATE INDEX ix_events_event_type_id_time_fired_ts ON events (event_type_id, time_fired_ts);
sqlite> .tables
event_data schema_changes states_temp_1720627841
event_types state_attributes statistics
events states statistics_meta
migration_changes states_meta statistics_runs
recorder_runs states_temp_1720625711 statistics_short_term
Database looks fine, doesn’t it?
nickrout
(Nick Rout)
July 20, 2024, 11:12am
129
Have you read the post immediately above yours?
bkbartk
(Bkbartk)
July 21, 2024, 7:00pm
130
2024.7.3 fixes my energy dashboard issues.
now I noticed that sometimes (on iOS) the interface won’t load,
don’t know if this is related to anything
Try to reset the frontend cache (under the companion app settings). I’m not sure it will solve an intermittent issue though, but worth a try.
GarryG
(Garry G)
July 24, 2024, 8:45am
132
Not sure if this is the same issue, but when upgrading from 2024.6.4 to 2024.7.2 or .3, while the normal entity charts look fine, all the History access is stuck … i.e., I click a chart, the popup with the history charge opens, but the data keeps loading, forever … how can I diagnose the cause of this?
zigomatic
(zigomatic)
July 26, 2024, 7:00am
133
May be link to the DB rebuild, this take times. Check your logs
I was told in discord this was fixed with 2024.7.3 , but I still have this problem. At 4 AM my recorder stops working, and manually calling a ‘purge’ in the developer tools section also recreates the issue. What’s going on?
GarryG
(Garry G)
July 27, 2024, 7:48am
135
OK, for the .3 update, I just checked immediately after the update because for .2, I lost 2+ days of data due to going back to the .6.4 backup, so I didn’t want to risk it … can I somehow initiate the rebuild (or whatever it is that’s stopping the history from working), in order to see if it is indeed fixed with the .3 patch?
If you run HA in a manually managed Docker container, you could spin up a second container to test the migration procedure. You need to make sure though, that you have enough free RAM and disk space. This is what I did.
Edit: Sorry, I misunderstood your question. The next answer after mine is more appropriate I think. You can also check the logs to see if the migration was successful.
CaptTom
(Tom)
July 27, 2024, 12:24pm
137
In Developer Tools / Services you could select Recorder: Purge . Select a Days to Keep, then Repack , then be sure to slide the switch next to Repack to “on.” (No, I don’t know why HA requires you to select the same thing twice on the same line.)
The one is to include the option and the second is to provide its (new) value. What makes it feel silly is that it has a default, so if you deviate from that, it seems like doing the same thing twice. A better UX would be to enable the option automatically the moment you change the default value.
1 Like
CaptTom
(Tom)
July 28, 2024, 1:15am
139
parautenbach:
The one is to include the option and the second is to provide its (new) value. What makes it feel silly is that it has a default, so if you deviate from that, it seems like doing the same thing twice.
I’m not sure I understand. From what I can see, there are two binary selections for “Repack”; one check box and one slider. There are no other options. Unless I’m missing something, both of them have to be selected or nothing happens, right?
Obviously either one of those selection methods would be fine, by itself. Or, as you say, have the UI automatically select one when the user selects the other. That would still be silly, but at least it wouldn’t be a trap for the unsuspecting user who might not notice the on/off slider way over on the right.
A minor point perhaps, but I do think it’s only fair to mention it whenever instructing someone to use this option.
CaptTom:
I’m not sure I understand. From what I can see, there are two binary selections for “Repack”; one check box and one slider. There are no other options. Unless I’m missing something, both of them have to be selected or nothing happens, right?
Sorry, I thought you were referring to this.
CaptTom
(Tom)
July 28, 2024, 9:07pm
141
Yes, exactly. At first I would check the “Repack” box, but forget to go over and turn “on” the slider switch. It seemed to me no repack took place unless I did both. If that’s the case, it seems a less than optimal UI. Or maybe I’m totally missing the point.