Home Assistant becomes unresponsive after certain period of time. HELP!

I’ve had HA running for years without issue in a VM on my unraid server.

In last few weeks, I’ve started to have issues where my system becomes unresponsive. The UI is interactive, but it seems like underlying there is an issue with services or something…. things like trying o add automations, lookup device values, etc. It’s as if the UI is working but the core system underneath has failed/shutdown

i can’t even issue a restart from the dev tools.

If i connect to the VM session, ha is interactive at the command line. I can then do stuff like ha core check which is successful. I then force a restart with ha core restart and everything then comes back up.

Doing a ha core logs shows all sorts of errors about timeouts, which corroborates my thought something fundamental is borked. Example of errors in the core logs:

File "/usr/src/homeassistant/homeassistant/components/rest/switch.py", line 215, in get_device_state
    req = await websession.get(
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 535, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 522, in connect
    raise e
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 512, in connect
    await fut

Idk how else to debug this… and forcing a restart via command line is clearly annoying to resolve this.

Most recently, my home assistant db got corrupted, and after researching it, the best/easiest thing to do was just delete that file despite losing history (I don’t care much about that). Restarting HA after that everything was good… Not sure if this is related to that, as I did that a few days ago, but this unresponsive issue preceded it. Only mention it since that happened recently.

I’m going out of my mind… help!

Anyone have any ideas?