-
-
Notifications
You must be signed in to change notification settings - Fork 36.6k
Description
The problem
Recorder stops recording after purge action is called. CPU stays at 100% for hours.
Behaviour started two days ago on sunday 2025-02-16 around 4 am, when purge was called - maybe something to do with rebuild?
No version updates or changes in configuration around that time. The night before, everything was fine.
Maybe related to #117263 and #123348.
My Database is about 3 GB in size, i still have 70 GB of hard drive space left. Does not make a difference whether I choose to rebuild or not when calling purge.
I tried
sudo sqlite3 home-assistant_v2.db
sqlite3 > VACUUM main INTO "out.db"
and copied back the result
This shrinks my db by 100 MB and the new db works in home assistant, but does not cure the problem.
For the moment, i set auto_purge: false in configuration.yaml
@bdraco: You were extremely helpful for the above mentioned issues, any ideas for my incarnation of the issue?
What version of Home Assistant Core has the issue?
core-2025.2.4
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
Recorder
Link to integration documentation on our website
https://www.home-assistant.io/integrations/recorder/#service-purge
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?
Full log output with
logger:
default: warning
logs:
homeassistant.components.recorder.purge: debug
after starting purge:
2025-02-18 23:27:27.471 DEBUG (Recorder) [homeassistant.components.recorder.purge] Purging states and events before target 2025-02-08 22:27:27+00:00
2025-02-18 23:27:27.471 DEBUG (Recorder) [homeassistant.components.recorder.purge] Purge running in new format as there are NO states with event_id remaining
2025-02-18 23:27:27.524 DEBUG (Recorder) [homeassistant.components.recorder.purge] Selected 4000 state ids and 696 attributes_ids to remove
2025-02-18 23:27:27.661 DEBUG (Recorder) [homeassistant.components.recorder.purge] Updated <sqlalchemy.engine.cursor.CursorResult object at 0x7fd25c6f1080> states to remove old_state_id
2025-02-18 23:27:27.723 DEBUG (Recorder) [homeassistant.components.recorder.purge] Deleted <sqlalchemy.engine.cursor.CursorResult object at 0x7fd26acebbd0> states
2025-02-18 23:27:27.739 DEBUG (Recorder) [homeassistant.components.recorder.purge] Selected 4000 state ids and 687 attributes_ids to remove
2025-02-18 23:27:27.835 DEBUG (Recorder) [homeassistant.components.recorder.purge] Updated <sqlalchemy.engine.cursor.CursorResult object at 0x7fd25c6f1080> states to remove old_state_id
2025-02-18 23:27:27.893 DEBUG (Recorder) [homeassistant.components.recorder.purge] Deleted <sqlalchemy.engine.cursor.CursorResult object at 0x7fd26acebbd0> states
2025-02-18 23:27:27.910 DEBUG (Recorder) [homeassistant.components.recorder.purge] Selected 4000 state ids and 715 attributes_ids to remove
2025-02-18 23:27:28.007 DEBUG (Recorder) [homeassistant.components.recorder.purge] Updated <sqlalchemy.engine.cursor.CursorResult object at 0x7fd25c6f1080> states to remove old_state_id
2025-02-18 23:27:28.063 DEBUG (Recorder) [homeassistant.components.recorder.purge] Deleted <sqlalchemy.engine.cursor.CursorResult object at 0x7fd26acebbd0> states
2025-02-18 23:27:28.078 DEBUG (Recorder) [homeassistant.components.recorder.purge] Selected 4000 state ids and 714 attributes_ids to remove
2025-02-18 23:27:28.177 DEBUG (Recorder) [homeassistant.components.recorder.purge] Updated <sqlalchemy.engine.cursor.CursorResult object at 0x7fd25c6f1080> states to remove old_state_id
2025-02-18 23:27:28.234 DEBUG (Recorder) [homeassistant.components.recorder.purge] Deleted <sqlalchemy.engine.cursor.CursorResult object at 0x7fd26acebbd0> states
2025-02-18 23:27:28.250 DEBUG (Recorder) [homeassistant.components.recorder.purge] Selected 4000 state ids and 671 attributes_ids to remove
2025-02-18 23:27:28.349 DEBUG (Recorder) [homeassistant.components.recorder.purge] Updated <sqlalchemy.engine.cursor.CursorResult object at 0x7fd25c6f1080> states to remove old_state_id
2025-02-18 23:27:28.406 DEBUG (Recorder) [homeassistant.components.recorder.purge] Deleted <sqlalchemy.engine.cursor.CursorResult object at 0x7fd26acebbd0> states
2025-02-18 23:27:28.422 DEBUG (Recorder) [homeassistant.components.recorder.purge] Selected 4000 state ids and 580 attributes_ids to remove
2025-02-18 23:27:28.522 DEBUG (Recorder) [homeassistant.components.recorder.purge] Updated <sqlalchemy.engine.cursor.CursorResult object at 0x7fd25c6f1080> states to remove old_state_id
2025-02-18 23:27:28.580 DEBUG (Recorder) [homeassistant.components.recorder.purge] Deleted <sqlalchemy.engine.cursor.CursorResult object at 0x7fd26acebbd0> states
2025-02-18 23:27:28.595 DEBUG (Recorder) [homeassistant.components.recorder.purge] Selected 4000 state ids and 478 attributes_ids to remove
2025-02-18 23:27:28.694 DEBUG (Recorder) [homeassistant.components.recorder.purge] Updated <sqlalchemy.engine.cursor.CursorResult object at 0x7fd25c6f1080> states to remove old_state_id
2025-02-18 23:27:28.752 DEBUG (Recorder) [homeassistant.components.recorder.purge] Deleted <sqlalchemy.engine.cursor.CursorResult object at 0x7fd26acebbd0> states
2025-02-18 23:27:28.769 DEBUG (Recorder) [homeassistant.components.recorder.purge] Selected 4000 state ids and 457 attributes_ids to remove
2025-02-18 23:27:28.870 DEBUG (Recorder) [homeassistant.components.recorder.purge] Updated <sqlalchemy.engine.cursor.CursorResult object at 0x7fd25c6f1080> states to remove old_state_id
2025-02-18 23:27:28.930 DEBUG (Recorder) [homeassistant.components.recorder.purge] Deleted <sqlalchemy.engine.cursor.CursorResult object at 0x7fd26acebbd0> states
2025-02-18 23:27:28.946 DEBUG (Recorder) [homeassistant.components.recorder.purge] Selected 4000 state ids and 450 attributes_ids to remove
2025-02-18 23:27:29.045 DEBUG (Recorder) [homeassistant.components.recorder.purge] Updated <sqlalchemy.engine.cursor.CursorResult object at 0x7fd25c6f1080> states to remove old_state_id
2025-02-18 23:27:29.105 DEBUG (Recorder) [homeassistant.components.recorder.purge] Deleted <sqlalchemy.engine.cursor.CursorResult object at 0x7fd26acebbd0> states
2025-02-18 23:27:29.122 DEBUG (Recorder) [homeassistant.components.recorder.purge] Selected 4000 state ids and 372 attributes_ids to remove
2025-02-18 23:27:29.220 DEBUG (Recorder) [homeassistant.components.recorder.purge] Updated <sqlalchemy.engine.cursor.CursorResult object at 0x7fd25c6f1080> states to remove old_state_id
2025-02-18 23:27:29.279 DEBUG (Recorder) [homeassistant.components.recorder.purge] Deleted <sqlalchemy.engine.cursor.CursorResult object at 0x7fd26acebbd0> states
2025-02-18 23:27:29.295 DEBUG (Recorder) [homeassistant.components.recorder.purge] Selected 4000 state ids and 399 attributes_ids to remove
2025-02-18 23:27:29.395 DEBUG (Recorder) [homeassistant.components.recorder.purge] Updated <sqlalchemy.engine.cursor.CursorResult object at 0x7fd260933d20> states to remove old_state_id
2025-02-18 23:27:29.456 DEBUG (Recorder) [homeassistant.components.recorder.purge] Deleted <sqlalchemy.engine.cursor.CursorResult object at 0x7fd26acebbd0> states
2025-02-18 23:27:29.472 DEBUG (Recorder) [homeassistant.components.recorder.purge] Selected 4000 state ids and 430 attributes_ids to remove
2025-02-18 23:27:29.572 DEBUG (Recorder) [homeassistant.components.recorder.purge] Updated <sqlalchemy.engine.cursor.CursorResult object at 0x7fd25c6f2cf0> states to remove old_state_id
2025-02-18 23:27:29.632 DEBUG (Recorder) [homeassistant.components.recorder.purge] Deleted <sqlalchemy.engine.cursor.CursorResult object at 0x7fd2644df7e0> states
2025-02-18 23:27:29.649 DEBUG (Recorder) [homeassistant.components.recorder.purge] Selected 4000 state ids and 476 attributes_ids to remove
2025-02-18 23:27:29.750 DEBUG (Recorder) [homeassistant.components.recorder.purge] Updated <sqlalchemy.engine.cursor.CursorResult object at 0x7fd2644dc050> states to remove old_state_id
2025-02-18 23:27:29.812 DEBUG (Recorder) [homeassistant.components.recorder.purge] Deleted <sqlalchemy.engine.cursor.CursorResult object at 0x7fd2644df7e0> states
2025-02-18 23:27:29.828 DEBUG (Recorder) [homeassistant.components.recorder.purge] Selected 4000 state ids and 457 attributes_ids to remove
2025-02-18 23:27:29.929 DEBUG (Recorder) [homeassistant.components.recorder.purge] Updated <sqlalchemy.engine.cursor.CursorResult object at 0x7fd2644df7e0> states to remove old_state_id
2025-02-18 23:27:29.988 DEBUG (Recorder) [homeassistant.components.recorder.purge] Deleted <sqlalchemy.engine.cursor.CursorResult object at 0x7fd26acebbd0> states
2025-02-18 23:27:30.006 DEBUG (Recorder) [homeassistant.components.recorder.purge] Selected 4000 state ids and 462 attributes_ids to remove
2025-02-18 23:27:30.105 DEBUG (Recorder) [homeassistant.components.recorder.purge] Updated <sqlalchemy.engine.cursor.CursorResult object at 0x7fd2644df7e0> states to remove old_state_id
2025-02-18 23:27:30.164 DEBUG (Recorder) [homeassistant.components.recorder.purge] Deleted <sqlalchemy.engine.cursor.CursorResult object at 0x7fd26acebbd0> states
2025-02-18 23:27:30.180 DEBUG (Recorder) [homeassistant.components.recorder.purge] Selected 4000 state ids and 435 attributes_ids to remove
2025-02-18 23:27:30.281 DEBUG (Recorder) [homeassistant.components.recorder.purge] Updated <sqlalchemy.engine.cursor.CursorResult object at 0x7fd2644df7e0> states to remove old_state_id
2025-02-18 23:27:30.341 DEBUG (Recorder) [homeassistant.components.recorder.purge] Deleted <sqlalchemy.engine.cursor.CursorResult object at 0x7fd26acebbd0> states
2025-02-18 23:27:30.358 DEBUG (Recorder) [homeassistant.components.recorder.purge] Selected 4000 state ids and 439 attributes_ids to remove
2025-02-18 23:27:30.460 DEBUG (Recorder) [homeassistant.components.recorder.purge] Updated <sqlalchemy.engine.cursor.CursorResult object at 0x7fd2644df7e0> states to remove old_state_id
2025-02-18 23:27:30.521 DEBUG (Recorder) [homeassistant.components.recorder.purge] Deleted <sqlalchemy.engine.cursor.CursorResult object at 0x7fd27d753230> states
2025-02-18 23:27:30.539 DEBUG (Recorder) [homeassistant.components.recorder.purge] Selected 4000 state ids and 507 attributes_ids to remove
2025-02-18 23:27:30.646 DEBUG (Recorder) [homeassistant.components.recorder.purge] Updated <sqlalchemy.engine.cursor.CursorResult object at 0x7fd27cb026d0> states to remove old_state_id
2025-02-18 23:27:30.707 DEBUG (Recorder) [homeassistant.components.recorder.purge] Deleted <sqlalchemy.engine.cursor.CursorResult object at 0x7fd26642c1a0> states
2025-02-18 23:27:30.725 DEBUG (Recorder) [homeassistant.components.recorder.purge] Selected 4000 state ids and 499 attributes_ids to remove
2025-02-18 23:27:30.828 DEBUG (Recorder) [homeassistant.components.recorder.purge] Updated <sqlalchemy.engine.cursor.CursorResult object at 0x7fd27cb026d0> states to remove old_state_id
2025-02-18 23:27:30.891 DEBUG (Recorder) [homeassistant.components.recorder.purge] Deleted <sqlalchemy.engine.cursor.CursorResult object at 0x7fd26642c1a0> states
2025-02-18 23:27:30.912 DEBUG (Recorder) [homeassistant.components.recorder.purge] Selected 4000 state ids and 493 attributes_ids to remove
2025-02-18 23:27:31.013 DEBUG (Recorder) [homeassistant.components.recorder.purge] Updated <sqlalchemy.engine.cursor.CursorResult object at 0x7fd27cb026d0> states to remove old_state_id
2025-02-18 23:27:31.074 DEBUG (Recorder) [homeassistant.components.recorder.purge] Deleted <sqlalchemy.engine.cursor.CursorResult object at 0x7fd26642c1a0> states
2025-02-18 23:27:32.106 DEBUG (Recorder) [homeassistant.components.recorder.purge] Selected 8996 shared attributes to remove
2025-02-18 23:27:32.356 DEBUG (Recorder) [homeassistant.components.recorder.purge] Deleted <sqlalchemy.engine.cursor.CursorResult object at 0x7fd25c6f03d0> attribute states
2025-02-18 23:27:32.481 DEBUG (Recorder) [homeassistant.components.recorder.purge] Deleted <sqlalchemy.engine.cursor.CursorResult object at 0x7fd25c6f16a0> attribute states
2025-02-18 23:27:32.515 DEBUG (Recorder) [homeassistant.components.recorder.purge] Deleted <sqlalchemy.engine.cursor.CursorResult object at 0x7fd25c6f03d0> attribute states
2025-02-18 23:27:32.516 DEBUG (Recorder) [homeassistant.components.recorder.purge] After purging states and attributes_ids remaining=True
2025-02-18 23:27:32.537 DEBUG (Recorder) [homeassistant.components.recorder.purge] Selected 4000 event ids and 1651 data_ids to removeAdditional information
No response