Skip to content
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

Period of no sensor updates after 2024.7.0 upgrade (4:11am) #121232

Closed
bbrks opened this issue Jul 4, 2024 · 20 comments
Closed

Period of no sensor updates after 2024.7.0 upgrade (4:11am) #121232

bbrks opened this issue Jul 4, 2024 · 20 comments

Comments

@bbrks
Copy link

bbrks commented Jul 4, 2024

The problem

After upgrading to 2024.7.0, which went OK... randomly all of my sensors failed to update after 04:11

I manually restarted HA at 09:49 and sensor updates resumed OK.

Screenshot 2024-07-04 at 17 43 30

With a sample size of two, oddly enough, my friend's HA system also showed the exact same failure and the **exact same time**.
Our systems are not connected or related in any way, other than being upgraded in the evening before the issue.

image (6)
image (5)

Could this be down to a faulty scheduled task or something?

What version of Home Assistant Core has the issue?

core-2024.7.0

What was the last working version of Home Assistant Core?

core-2024.6.5

What type of installation are you running?

Home Assistant OS

Integration causing the issue

n/a - all sensors affected

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Sorry, I have no covering logs.

Additional information

No response

@JRascagneres
Copy link

I am said friend 😄
I think this issue may be related too - #121154 - It was closed as the restart appears to fix it but not great behaviour either way and wondering if it'll retrigger tomorrow.

@ChristophCaina
Copy link
Contributor

probably related with this: #121164

@bbrks
Copy link
Author

bbrks commented Jul 4, 2024

I agree. Sorry for the noise with the duplicate issue! I tried to search for related issues before filing and couldn't see any relevant from the titles.

Looks like this is a common enough issue it'll be noticed and addressed one way or another rather quickly!

@bbrks bbrks changed the title Period of no sensor updates after 2024.7.0 upgrade Period of no sensor updates after 2024.7.0 upgrade (4:11am) Jul 4, 2024
@ChopperRob
Copy link
Contributor

I had the same issue, around 12 hours after installing the latest version the issue started. A reboot fixed it for now.

@lordleicester
Copy link

Same for me.
Updated to 2024.07 at 21:48 on 04.07.2024.
Values froze at 4:12 ob 05.07.2024
Reboot fixed my Problem for now

@github-k8n
Copy link

github-k8n commented Jul 5, 2024

Same here but it occurred now the second day. Rebooted yesterday morning to get data going again, tonight it stopped again showing updates. I can't go and reboot every night at around 4 ...

@ChristophCaina
Copy link
Contributor

ChristophCaina commented Jul 5, 2024

my workaround for now is an automated reboot at 04:15 via automation.

you can also check, if the issue happens, after running recorder.purge

@JRascagneres
Copy link

I've downgraded for now, its a very poor bug.

@dbachats
Copy link

dbachats commented Jul 5, 2024

same situation for me also

@danieljowitsch
Copy link

Have the same issue, statistics disappeared after 2024.7 update. I have these log entries and it almost looks as if the icloud3 integration is the culprit.

image

Logger: homeassistant.components.recorder.util
Source: components/recorder/util.py:137
integration: Recorder (documentation, issues)
First occurred: July 4, 2024 at 8:20:24 PM (135 occurrences)
Last logged: 7:30:10 AM

Error executing query
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 137, in session_scope
yield session
File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 477, in compile_missing_statistics
modified_statistic_ids = _compile_statistics(
^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 559, in _compile_statistics
compiled: PlatformCompiledStatistics = platform_compile_statistics(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 400, in compile_statistics
sensor_states = _get_sensor_states(hass)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 92, in _get_sensor_states
and (not entity_filter or entity_filter(state.entity_id))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/icloud3/support/recorder_prefilter.py", line 123, in entity_filter
return recorder_entity_filter(entity_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not callable

@ZahiCZ
Copy link

ZahiCZ commented Jul 6, 2024

I have the same issue after update to 2024.7.0. the update to 2024.7.1 has not solved it as well.

@ChristophCaina
Copy link
Contributor

@ZahiCZ
Can you maybe provide a bit more input?
please check, if it is an issue related to one of the following integrations
https://community.home-assistant.io/t/psa-2024-7-recorder-problems/746428

if not, please check, when exactly your recorder will stop working - and if you can reproduce it after running the service 'recorder.purge'

@danieljowitsch
Copy link

danieljowitsch commented Jul 6, 2024

iCloud 3 was the offending integration for me. After disabling the recorder has started working.

@ZahiCZ
Copy link

ZahiCZ commented Jul 7, 2024

@ZahiCZ Can you maybe provide a bit more input? please check, if it is an issue related to one of the following integrations https://community.home-assistant.io/t/psa-2024-7-recorder-problems/746428

if not, please check, when exactly your recorder will stop working - and if you can reproduce it after running the service 'recorder.purge'

Hi, I don´t use icloud3, places or hass-variables. I don´t know, what can block it. whole homeassistant is up to date. When I start service recorder.purge manualy, I have same result. sencors are not saved to database.
image
the size of current db file is:
image
can this the issue?

is there any purge log? to see what caused it.

Thank you for your help

@ChristophCaina
Copy link
Contributor

the issue is probably an empty index in your database, that will cause a full tablescan when recorder.purge will be executed.
A workaround could be, to disable "auto_purge" ...
For this, you need to add the following to your configuration.yaml:

recorder:
  auto_purge: false

when a fix will be delivered (probably with 2024.8) you should remove this again from your config.

@ZahiCZ
Copy link

ZahiCZ commented Jul 7, 2024

Hi, I know about this solution. I am worried about d,atabase size. without purge the database increases about 130MB per day.
Ok, I will disable auto purge.

Thank you

@ChristophCaina
Copy link
Contributor

ok, the problem is, that if the database will be in a deadlock, due to the auto_purge, there's probably the same issue in the end.
You restart HA, the recorder is working again, but the database did not be cleaned up.
you could also consider to configure some entities to be excluded from the history - for example, battery states, or other entities for which you don't really need a history.
That could help with the db grow rate.

@bdraco
Copy link
Member

bdraco commented Jul 8, 2024

duplicate of #117263

@bdraco bdraco closed this as not planned Won't fix, can't repro, duplicate, stale Jul 8, 2024
@home-assistant
Copy link

home-assistant bot commented Jul 8, 2024

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (recorder) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of recorder can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign recorder Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


recorder documentation
recorder source
(message by IssueLinks)

@dbachats
Copy link

hi unfortunatelly the problem persists even after the 2024.7.2 update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants