Recorder stops working every night

So, my recorder seems to stop working every night at around 04:30 and I have no clue why. I use MariaDB on a Synology NAS (DS920+) and it has worked fine the last couple of months.

The issue started somewhere in the middle of last month - nothing has changed then and I just created an automation to reboot Home Assistant at 05:00 and wait for an update in the hope this would fix it. 2022.12 came, then the first and second update, but still, somewhere between 04:15 and 04:45 the recorder still breaks.

There are no errors in the logs (at least in the “normal” logs in settings > system > logs)

How could I figure out what is going on there?

1 Like

Did you get anywhere with this? I have the same issue - and it always seems to be between 4-5am as well! And a restart is the only way to get the history recording again.
Running latest HA, on intel nuc with mariadb.

# Database! Using maria db addon rather than default sqllite
recorder:
  purge_keep_days: 90
  auto_purge: true
  db_url: mysql://homeassistant:********@core-mariadb/homeassistant?charset=utf8
  include:
    domains:
      - sensor
      - switch
      - binary_sensor
      - person
      - media_player
      - remote
      - camera
      - text_input
      - input_boolean
      - device_tracker

Assuming this is the purge getting ‘stuck’ somehow (docs says it runs at 04:12 every day)?

1 Like

I also have this problem - still in Version 2024.1.5 - Sometime the recording stops - and then the Energy Dashboard also still has no data - and then after clicking on Data history or “Reloading” of Homassistant Core - the dataś will be recorded again.
…but the data they are missed they will not return again…

See picture of the enrergy dahsboard with missing data between the time of 11:00h - 2:00 PM …



see the electric - energy - recordings of this day for example:

2 Likes

Hello, Is have the same problem since some weeks. Is there no solution?

1 Like

I have upgraded to 2024.7.1 version and now weirdly enough at 4:15 every morning recorder stops working. Restarting home assistant fixes it. Anyone managed to find out what is causing it?

1 Like

Thats funny … I just came back to this thread, because after not having thought about this problem in ages, the same thing happened to me.
Installed 2024.7 (and 2024.7.1 yesterday) and the last days the recorder stops shortly after 04:00 every morning…

No Idea why - I see nothing out of the ordinary happening at that time.

Will just create an automation to reboot at 04:30 for now and wait for the next version…

EDIT: 2024.7 seems to make HA very slow in general - restarting (in Docker) takes incredibly long now- minutes, when it took just seconds previously

1 Like

Hi. Same for me. Stop everyday at 4:00 since 2024.7

1 Like

Seems to be a known issue … even though I don’t use any of the mentioned integrations

Also, recorder issues are mentioned on the 2024.7 release blog entry

Will try to disable auto-purge for now

I’m having the exact same issue since I upgraded to 2024.7, recorder just stops, and if I restart via the UI, it takes ages (if I just destroy the container is much faster).

This is what I can see in logs when restarting via UI:

2024-07-07 10:29:50.242 WARNING (MainThread) [homeassistant.core] Timed out waiting for final writes to complete, the shutdown will continue
2024-07-07 10:29:50.242 WARNING (MainThread) [homeassistant.core] Shutdown stage 'final write': still running: <Task pending name='Task-249426' coro=<Recorder._async_shutdown() running at /usr/src/homeassistant/homeassistant/components/recorder/core.py:480> wait_for=<Future pending cb=[_chain_future.<locals>._call_check_cancel() at /usr/local/lib/python3.12/asyncio/futures.py:387, <1 more>, Task.task_wakeup()]> cb=[set.remove()]>
2024-07-07 10:30:20.322 WARNING (MainThread) [homeassistant.core] Timed out waiting for close event to be processed, the shutdown will continue
2024-07-07 10:30:20.323 WARNING (MainThread) [homeassistant.core] Shutdown stage 'close': still running: <Task pending name='Task-249426' coro=<Recorder._async_shutdown() running at /usr/src/homeassistant/homeassistant/components/recorder/core.py:480> wait_for=<Future pending cb=[_chain_future.<locals>._call_check_cancel() at /usr/local/lib/python3.12/asyncio/futures.py:387, <1 more>, Task.task_wakeup()]> cb=[set.remove()]>
2024-07-07 10:30:20.323 WARNING (MainThread) [homeassistant.core] Shutdown stage 'close': still running: <Task pending name='Task-249447' coro=<Recorder._async_close() running at /usr/src/homeassistant/homeassistant/components/recorder/core.py:472> wait_for=<Future pending cb=[_chain_future.<locals>._call_check_cancel() at /usr/local/lib/python3.12/asyncio/futures.py:387, <1 more>, Task.task_wakeup()]> cb=[set.remove()]>
2024-07-07 10:30:20.343 WARNING (Thread-7 (_do_shutdown)) [homeassistant.util.executor] Thread[SyncWorker_62] is still running at shutdown: File "/usr/local/lib/python3.12/threading.py", line 1030, in _bootstrap
    self._bootstrap_inner()
  File "/usr/local/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.12/threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 92, in _worker
    work_item.run()
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.12/threading.py", line 1147, in join
    self._wait_for_tstate_lock()
  File "/usr/local/lib/python3.12/threading.py", line 1167, in _wait_for_tstate_lock
    if lock.acquire(block, timeout):