Problems with restarts

Hello all,

I am currently having big problems with Homeassistant restarting several times a day. I can’t explain it and hope that you have an idea.
My system runs on a NUC with Proxmox.

Supervisor gives me the following logs:

24-01-31 19:40:02 WARNING (MainThread) [supervisor.homeassistant.websocket] Connection is closed
24-01-31 19:40:02 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API error: Cannot proxy websocket message of unsupported type: 257
24-01-31 19:40:02 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API error: Cannot proxy websocket message of unsupported type: 257
24-01-31 19:40:02 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API connection is closed
24-01-31 19:40:02 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API connection is closed
24-01-31 19:40:07 WARNING (MainThread) [supervisor.homeassistant.core] Watchdog found Home Assistant failed, restarting...
24-01-31 19:40:07 INFO (SyncWorker_4) [supervisor.docker.manager] Starting homeassistant
24-01-31 19:40:07 INFO (MainThread) [supervisor.homeassistant.core] Wait until Home Assistant is ready
24-01-31 19:40:09 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state running
24-01-31 19:40:10 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
24-01-31 19:40:11 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/zigbee2mqtt/hassio-zigbee2mqtt repository
24-01-31 19:40:11 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/esphome/home-assistant-addon repository
24-01-31 19:40:11 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/hassio-addons/repository repository
24-01-31 19:40:11 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/home-assistant/addons repository
24-01-31 19:40:11 INFO (MainThread) [supervisor.updater] Fetching update data from https://version.home-assistant.io/stable.json
24-01-31 19:40:12 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to NOT_RUNNING
24-01-31 19:40:13 INFO (MainThread) [supervisor.store] Loading add-ons from store: 80 all - 0 new - 0 remove
24-01-31 19:40:13 INFO (MainThread) [supervisor.store] Loading add-ons from store: 80 all - 0 new - 0 remove

This most often points to a problem with Core, which isn’t responding to periodical API checks from Supervisor. After two missed API calls, the Supervisor restarts the Core.

Can you try and restart the Core in Safe Mode? If the restarts happen in Safe Mode too, then this is indeed a Core issue an possibly deserves an issue in the Core repository. Recently there was a very similar issue reported, where it turned out to be caused by the CalDAV integration, see issue #109208.

I haven’t had this problem for a long time now. I had removed integrations that I don’t use or use very rarely.
Now I had problems with restarts again yesterday and today.

What functions do I still have on the system when I am in safe mode?

Safe mode essentially disables all custom integrations. The Core itself and it’s automations will continue to work. You can also simply restart again to go into regular mode again, so it is easy to just test.

Update1: I restarted the host after this comment, and since then i didnt get any Watchdog missed an Home Assistant Core API response message.

Hello, it seems that i also have similar problem. I restarted in safe mode yesterday. But after a while it restarts back to normal mode again, cant say when. Here is the latest log from supervisor. What should be my next step?

2024-08-06 09:33:01.833 INFO (MainThread) [supervisor.homeassistant.core] Wait until Home Assistant is ready
2024-08-06 09:33:13.426 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state running
2024-08-06 09:33:13.605 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
2024-08-06 09:33:16.231 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to NOT_RUNNING
2024-08-06 09:34:25.153 INFO (MainThread) [supervisor.resolution.check] Starting system checks with state running
2024-08-06 09:34:25.153 INFO (MainThread) [supervisor.resolution.checks.base] Run check for dns_server_failed/dns_server
2024-08-06 09:34:25.301 INFO (MainThread) [supervisor.resolution.checks.base] Run check for dns_server_ipv6_error/dns_server
2024-08-06 09:34:25.324 INFO (MainThread) [supervisor.resolution.checks.base] Run check for ipv4_connection_problem/system
2024-08-06 09:34:25.325 INFO (MainThread) [supervisor.resolution.checks.base] Run check for security/core
2024-08-06 09:34:25.326 INFO (MainThread) [supervisor.resolution.checks.base] Run check for multiple_data_disks/system
2024-08-06 09:34:25.327 INFO (MainThread) [supervisor.resolution.checks.base] Run check for free_space/system
2024-08-06 09:34:25.328 INFO (MainThread) [supervisor.resolution.checks.base] Run check for docker_config/system
2024-08-06 09:34:25.329 INFO (MainThread) [supervisor.resolution.checks.base] Run check for disabled_data_disk/system
2024-08-06 09:34:25.329 INFO (MainThread) [supervisor.resolution.checks.base] Run check for pwned/addon
2024-08-06 09:34:25.963 INFO (MainThread) [supervisor.resolution.checks.base] Run check for trust/supervisor
2024-08-06 09:34:25.971 INFO (MainThread) [supervisor.resolution.check] System checks complete
2024-08-06 09:34:25.971 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state running
2024-08-06 09:34:26.159 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
2024-08-06 09:34:26.159 INFO (MainThread) [supervisor.resolution.fixup] Starting system autofix at state running
2024-08-06 09:34:26.160 INFO (MainThread) [supervisor.resolution.fixup] System autofix complete
2024-08-06 09:38:40.971 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to STARTING
2024-08-06 09:39:05.031 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to RUNNING
2024-08-06 09:39:05.031 INFO (MainThread) [supervisor.homeassistant.core] Detect a running Home Assistant instance
2024-08-06 09:43:10.122 WARNING (MainThread) [supervisor.misc.tasks] Watchdog missed an Home Assistant Core API response.
2024-08-06 09:53:14.263 WARNING (MainThread) [supervisor.misc.tasks] Watchdog missed an Home Assistant Core API response.
2024-08-06 09:55:19.550 ERROR (MainThread) [supervisor.misc.tasks] Watchdog missed 2 Home Assistant Core API responses in a row. Restarting Home Assistant Core!
2024-08-06 09:55:19.603 INFO (SyncWorker_9) [supervisor.docker.manager] Restarting homeassistant
2024-08-06 09:55:20.512 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-507724676' coro=<HomeAssistantWebSocket.async_supervisor_event() done, defined at /usr/src/supervisor/supervisor/homeassistant/websocket.py:321> exception=AttributeError("'NoneType' object has no attribute 'close'")>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 266, in async_send_message
    await self._client.async_send_command(message)
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 94, in async_send_command
    return await self._futures[message["id"]]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
supervisor.exceptions.HomeAssistantWSConnectionError: Connection was closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 326, in async_supervisor_event
    await self.async_send_message(
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 268, in async_send_message
    await self._client.close()
          ^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'close'
2024-08-06 09:55:41.943 INFO (MainThread) [supervisor.homeassistant.core] Wait until Home Assistant is ready
2024-08-06 09:55:52.018 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state running
2024-08-06 09:55:52.221 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
2024-08-06 09:55:56.098 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API token
2024-08-06 09:55:56.121 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to NOT_RUNNING
2024-08-06 10:01:16.826 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to STARTING
2024-08-06 10:01:41.459 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to RUNNING
2024-08-06 10:01:41.460 INFO (MainThread) [supervisor.homeassistant.core] Detect a running Home Assistant instance
2024-08-06 10:03:44.197 WARNING (MainThread) [supervisor.misc.tasks] Watchdog missed an Home Assistant Core API response.
2024-08-06 10:04:53.983 INFO (MainThread) [supervisor.host.info] Updating local host information
2024-08-06 10:04:54.805 INFO (MainThread) [supervisor.host.services] Updating service information
2024-08-06 10:04:54.826 INFO (MainThread) [supervisor.host.network] Updating local network information
2024-08-06 10:04:55.438 INFO (MainThread) [supervisor.host.sound] Updating PulseAudio information
2024-08-06 10:04:55.446 INFO (MainThread) [supervisor.host.manager] Host information reload completed
2024-08-06 10:05:48.919 ERROR (MainThread) [supervisor.misc.tasks] Watchdog missed 2 Home Assistant Core API responses in a row. Restarting Home Assistant Core!
2024-08-06 10:05:48.957 INFO (SyncWorker_6) [supervisor.docker.manager] Restarting homeassistant
2024-08-06 10:05:50.993 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-507986874' coro=<HomeAssistantWebSocket.async_supervisor_event() done, defined at /usr/src/supervisor/supervisor/homeassistant/websocket.py:321> exception=AttributeError("'NoneType' object has no attribute 'close'")>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 266, in async_send_message
    await self._client.async_send_command(message)
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 94, in async_send_command
    return await self._futures[message["id"]]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
supervisor.exceptions.HomeAssistantWSConnectionError: Connection was closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 326, in async_supervisor_event
    await self.async_send_message(
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 268, in async_send_message
    await self._client.close()
          ^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'close'
2024-08-06 10:06:17.039 INFO (MainThread) [supervisor.homeassistant.core] Wait until Home Assistant is ready
2024-08-06 10:06:23.733 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to NOT_RUNNING
2024-08-06 10:06:23.744 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state running
2024-08-06 10:06:23.984 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
2024-08-06 10:11:51.181 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to STARTING
2024-08-06 10:12:09.834 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to RUNNING
2024-08-06 10:12:09.834 INFO (MainThread) [supervisor.homeassistant.core] Detect a running Home Assistant instance
2024-08-06 10:14:13.927 WARNING (MainThread) [supervisor.misc.tasks] Watchdog missed an Home Assistant Core API response.

I’m having the same issue. Here’s my supervisor logs with some context lines before and after:

2024-08-16 11:46:42.171 INFO (MainThread) [supervisor.api.proxy] WebSocket access from a0d7b954_vscode
2024-08-16 11:46:42.172 INFO (MainThread) [supervisor.api.proxy] WebSocket access from a0d7b954_vscode
2024-08-16 11:46:42.182 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request running
2024-08-16 11:46:42.183 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request running
2024-08-16 11:50:42.628 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API token
2024-08-16 11:57:13.645 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.
2024-08-16 11:57:13.645 WARNING (MainThread) [supervisor.misc.tasks] Watchdog missed an Home Assistant Core API response.
2024-08-16 11:57:32.644 WARNING (MainThread) [supervisor.misc.tasks] Watchdog/Application found a problem with observer plugin!
2024-08-16 11:57:32.647 INFO (SyncWorker_5) [supervisor.docker.manager] Stopping hassio_observer application
2024-08-16 11:57:32.809 INFO (SyncWorker_5) [supervisor.docker.manager] Cleaning hassio_observer application
2024-08-16 11:57:32.824 INFO (MainThread) [supervisor.plugins.observer] Starting observer plugin
2024-08-16 11:57:33.081 INFO (MainThread) [supervisor.docker.observer] Starting Observer ghcr.io/home-assistant/amd64-hassio-observer with version 2023.06.0 - 172.30.32.6
2024-08-16 11:59:44.644 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.
2024-08-16 11:59:44.644 ERROR (MainThread) [supervisor.misc.tasks] Watchdog missed 2 Home Assistant Core API responses in a row. Restarting Home Assistant Core!
2024-08-16 11:59:44.647 INFO (SyncWorker_4) [supervisor.docker.manager] Restarting homeassistant
2024-08-16 11:59:44.715 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API for a0d7b954_vscode closed
2024-08-16 11:59:44.716 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API for a0d7b954_vscode closed
2024-08-16 11:59:44.718 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API for a0d7b954_vscode closed
2024-08-16 12:00:55.620 INFO (MainThread) [supervisor.homeassistant.core] Wait until Home Assistant is ready
2024-08-16 12:00:57.908 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state running
2024-08-16 12:00:57.980 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
2024-08-16 12:01:00.632 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to APIState(core_state='NOT_RUNNING', offline_db_migration=False)
2024-08-16 12:01:48.933 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to APIState(core_state='STARTING', offline_db_migration=False)
2024-08-16 12:01:58.949 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to APIState(core_state='RUNNING', offline_db_migration=False)
2024-08-16 12:01:58.949 INFO (MainThread) [supervisor.homeassistant.core] Detect a running Home Assistant instance
2024-08-16 12:02:02.019 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request initialize
1 Like