HassOS unreachable few times a day

Hi all,
since 10 days i’m having issue with HassOS on a Pi 3B.
Few times a day it’s unreachable (frontend, ssh, samba) but I can ping the Pi.
After 5-10 mins it start working like a charm.
I updated yesterday the core to last version but It has the same problem.

This is my home-assistant.log

2021-03-08 08:18:30 WARNING (MainThread) [homeassistant.loader] You are using a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-03-08 08:18:30 WARNING (MainThread) [homeassistant.loader] You are using a custom integration alexa_media which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-03-08 08:18:32 WARNING (Recorder) [homeassistant.components.recorder.util] The system could not validate that the sqlite3 database at //config/home-assistant_v2.db was shutdown cleanly.
2021-03-08 08:18:40 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=10 from 2021-03-08 05:36:30.279120)
2021-03-08 08:19:00 WARNING (MainThread) [homeassistant.components.binary_sensor] Setup of binary_sensor platform cloud is taking over 10 seconds.
2021-03-08 08:19:00 WARNING (MainThread) [homeassistant.setup] Setup of input_boolean is taking over 10 seconds.
2021-03-08 08:19:00 WARNING (MainThread) [homeassistant.components.scene] Setup of scene platform homeassistant is taking over 10 seconds.
2021-03-08 08:19:00 WARNING (MainThread) [homeassistant.setup] Setup of counter is taking over 10 seconds.
2021-03-08 08:19:00 WARNING (MainThread) [homeassistant.setup] Setup of logbook is taking over 10 seconds.
2021-03-08 08:19:11 ERROR (MainThread) [metno] https://aa015h6buqvih86i1.api.met.no/weatherapi/locationforecast/2.0/complete returned 
2021-03-08 08:19:19 WARNING (MainThread) [homeassistant.config_entries] Config entry 'TL-WR902AC' for upnp integration not ready yet. Retrying in background
2021-03-08 08:19:52 WARNING (MainThread) [homeassistant.components.media_player] Updating alexa_media media_player took longer than the scheduled update interval 0:00:10
2021-03-08 08:42:14 WARNING (Thread-5) [homeassistant.components.mqtt] Disconnected from MQTT server core-mosquitto:1883 (1)
2021-03-08 08:42:30 WARNING (MainThread) [homeassistant.helpers.entity] Updating state for binary_sensor.persiana_finestra_sala_overheating (<class 'homeassistant.components.shelly.binary_sensor.ShellyBinarySensor'>) took 10.600 seconds. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+shelly%22
2021-03-08 08:44:28 WARNING (MainThread) [homeassistant.helpers.entity] Updating state for cover.persiana_finestra_sala (<class 'homeassistant.components.shelly.cover.ShellyCover'>) took 29.369 seconds. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+shelly%22
2021-03-08 08:44:45 WARNING (MainThread) [homeassistant.helpers.entity] Updating state for sensor.persiana_finestra_sala_device_temperature (<class 'homeassistant.components.shelly.sensor.ShellySensor'>) took 1.739 seconds. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+shelly%22
2021-03-08 08:44:52 WARNING (Thread-7) [pychromecast.socket_client] [Tv Salotto(192.168.1.102):8009] Heartbeat timeout, resetting connection
2021-03-08 08:46:57 WARNING (Thread-7) [pychromecast.socket_client] [Tv Salotto(192.168.1.102):8009] Error communicating with socket, resetting connection
2021-03-08 08:47:20 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547613540896] Unexpected error inside websocket API
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/http.py", line 197, in async_handle
    msg = await wsock.receive()
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_ws.py", line 438, in receive
    await self.pong(msg.data)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_ws.py", line 293, in pong
    await self._writer.pong(message)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 667, in pong
    await self._send_frame(message, WSMsgType.PONG)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 650, in _send_frame
    self._write(header + message)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 660, in _write
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
2021-03-08 08:47:23 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 673, in ping
    await self._send_frame(message, WSMsgType.PING)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 650, in _send_frame
    self._write(header + message)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 660, in _write
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
2021-03-08 08:47:23 WARNING (influxdb) [homeassistant.components.influxdb] Catching up, dropped 1 old events.
2021-03-08 08:47:23 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating rpi_power binary_sensor took longer than the scheduled update interval 0:00:30
2021-03-08 08:47:23 WARNING (MainThread) [homeassistant.components.sensor] Updating systemmonitor sensor took longer than the scheduled update interval 0:00:30
2021-03-08 08:47:23 WARNING (MainThread) [homeassistant.components.sensor] Updating daikin sensor took longer than the scheduled update interval 0:00:30
2021-03-08 08:47:23 WARNING (MainThread) [homeassistant.components.switch] Updating daikin switch took longer than the scheduled update interval 0:00:30
2021-03-08 08:47:23 WARNING (MainThread) [homeassistant.components.sensor] Updating daikin sensor took longer than the scheduled update interval 0:00:30
2021-03-08 08:47:23 WARNING (MainThread) [homeassistant.components.switch] Updating daikin switch took longer than the scheduled update interval 0:00:30
2021-03-08 08:47:23 WARNING (MainThread) [homeassistant.components.switch] Updating alexa_media switch took longer than the scheduled update interval 0:00:30
2021-03-08 08:47:23 WARNING (MainThread) [homeassistant.components.climate] Updating daikin climate took longer than the scheduled update interval 0:01:00
2021-03-08 08:47:23 WARNING (MainThread) [homeassistant.components.climate] Updating daikin climate took longer than the scheduled update interval 0:01:00
2021-03-08 08:48:11 WARNING (MainThread) [homeassistant.helpers.entity] Updating state for binary_sensor.remote_ui (<class 'homeassistant.components.cloud.binary_sensor.CloudRemoteBinary'>) took 0.772 seconds. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+cloud%22
2021-03-08 08:48:53 ERROR (MainThread) [snitun.multiplexer.core] Ping fails, no response from peer
2021-03-08 08:56:05 ERROR (MainThread) [homeassistant.components.upnp] Timeout fetching TL-WR902AC data
2021-03-08 09:03:00 WARNING (Thread-7) [pychromecast.socket_client] [Tv Salotto(192.168.1.102):8009] Heartbeat timeout, resetting connection
2021-03-08 09:05:28 WARNING (Thread-5) [homeassistant.components.mqtt] Disconnected from MQTT server core-mosquitto:1883 (1)
2021-03-08 09:05:38 WARNING (MainThread) [homeassistant.helpers.entity] Updating state for sensor.tl_wr902ac_kib_s_received (<class 'homeassistant.components.upnp.sensor.DerivedUpnpSensor'>) took 0.407 seconds. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+upnp%22
2021-03-08 09:05:40 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 673, in ping
    await self._send_frame(message, WSMsgType.PING)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 650, in _send_frame
    self._write(header + message)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 660, in _write
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
2021-03-08 09:05:53 WARNING (influxdb) [homeassistant.components.influxdb] Catching up, dropped 1 old events.
2021-03-08 09:07:09 ERROR (MainThread) [snitun.multiplexer.core] Ping fails, no response from peer
2021-03-08 10:01:22 ERROR (MainThread) [frontend.js.latest.202103025] https://MYADDRESS.ui.nabu.casa/local/community/kiosk-mode/kiosk-mode.js:7:40 TypeError: null is not an object (near '...Selector("hui-root")...')

The problem started around 8.40-8.45
Can someone help me find the problem?

Something which has been prevalent with recent releases is a corrupted database. Perhaps try deleting it.

Also, FYI you posted your public Nabu Casa address… Might want to edit that out

Yesterday I changed the SD card with a new one (so reinstalled home assistant and restored from snapshot) then i had to deleted the DB because was corrupted.
Is it normal that today is already corrupted?

Thanks for reporting about my Nabu Casa address

No, it shouldn’t be corrupting like that

I’m trying to figure out this


2021-03-08 08:47:20 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547613540896] Unexpected error inside websocket API
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/http.py", line 197, in async_handle
    msg = await wsock.receive()
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_ws.py", line 438, in receive
    await self.pong(msg.data)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_ws.py", line 293, in pong
    await self._writer.pong(message)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 667, in pong
    await self._send_frame(message, WSMsgType.PONG)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 650, in _send_frame
    self._write(header + message)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 660, in _write
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport

and this


2021-03-08 08:47:23 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 673, in ping
    await self._send_frame(message, WSMsgType.PING)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 650, in _send_frame
    self._write(header + message)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 660, in _write
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport

Hi @Undermix, did you find what was causing this problem? I am experiencing something very similar and am pulling my hair out trying find the cause.

Thanks,

Graeme.

What is your installation type? Raspberry pi? Wich model?

Home Assistant OS 5.13 on Raspberry Pi 4 (4GB).

For weeks now, it’s been becoming unreachable several times a day, but I think i may have solved my issue today (:crossed_fingers:), network related. My Pi is on a wired network, but it seems that for some reason it was still using wlan. I disabled the wifi through the terminal, and now with only eth0 available, it seems stable

nmcli radio wifi off
1 Like

I was using a pi 3b with some add-ons. I noticed that several times a day cpu and ram was saturated but I didn’t find the cause. I tried removing some add-ons and it helped a bit. I used wireless at the first installation on pi then I switched to wired. I’d never checked if this could be the problem.
I finally switched to VM instead of pi.

Hello, I have a RPI 3 with a Transcend SSD, 2GB swap file and a wired connection to Eth.I =My system was plagued by the “Host Unreachable” bug every 1 or less days. After searching everywhere I came across this thread that was pointing at WiFi as the culprit.
I checked with “nmcli” the status of WiFi and I found it was ENABLED.
I turned it OFF with the “nmcli radio wifi off” and after more than 3 days the situation looks stable. No more system lock.
In my case, when the host was unreachable, the whole system was stuck, no logging of the sensors and no way to itneract.
I hope this message helps and I will update the status in a week’s time,

1 Like
nmcli radio wifi off

nice finding, trying on HA yellow right now. hope it works, I’m struggling for weeks now, but it this really the issue this should be fixed in HAOS,

I looked like this was working for me for a few days,
unfortunately the issue seems suddenly to be back?
some logs

23-12-23 11:23:17 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request running
23-12-23 11:23:17 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request running
23-12-23 11:23:47 ERROR (MainThread) [supervisor.api.ingress] Stream error with http://172.30.33.6:1337/stable-d7a2b4936af1bfd80cb96f2567af68badc2325e3/static/out/vs/workbench/workbench.web.main.css: Cannot write to closing transport
23-12-23 11:24:28 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request initialize
23-12-23 11:24:29 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sentry_sdk/integrations/aiohttp.py", line 139, in sentry_app_handle
    reraise(*_capture_exception(hub))
  File "/usr/local/lib/python3.11/site-packages/sentry_sdk/_compat.py", line 115, in reraise
    raise value
  File "/usr/local/lib/python3.11/site-packages/sentry_sdk/integrations/aiohttp.py", line 129, in sentry_app_handle
    response = await old_handle(self, request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 186, in block_bad_requests
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 202, in system_validation
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 221, in token_validation
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 280, in core_proxy
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/proxy.py", line 209, in websocket
    response = await server.receive_json()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_ws.py", line 498, in receive_json
    data = await self.receive_str(timeout=timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_ws.py", line 482, in receive_str
    raise TypeError(
TypeError: Received message 257:None is not WSMsgType.TEXT
23-12-23 11:24:34 ERROR (MainThread) [supervisor.api.ingress] Stream error with http://172.30.33.6:1337/stable-d7a2b4936af1bfd80cb96f2567af68badc2325e3/static/out/vs/workbench/contrib/output/common/outputLinkComputer.js: Cannot write to closing transport
Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/http.py:371
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 12:26:28 (6 occurrences)
Last logged: 13:25:27

[546796946240] Supervisor from 172.30.32.2 (HomeAssistantSupervisor/2023.12.0 aiohttp/3.9.1 Python/3.11): Unexpected error inside websocket API
[546859286080] Supervisor from 172.30.32.2 (HomeAssistantSupervisor/2023.12.0 aiohttp/3.9.1 Python/3.11): Unexpected error inside websocket API
[546859283136] Supervisor from 172.30.32.2 (HomeAssistantSupervisor/2023.12.0 aiohttp/3.9.1 Python/3.11): Unexpected error inside websocket API
[546690873024] Supervisor from 172.30.32.2 (HomeAssistantSupervisor/2023.12.0 aiohttp/3.9.1 Python/3.11): Unexpected error inside websocket API
[546690862784] Supervisor from 172.30.32.2 (HomeAssistantSupervisor/2023.12.0 aiohttp/3.9.1 Python/3.11): Unexpected error inside websocket API
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/http.py", line 371, in async_handle
    msg = await wsock.receive()
          ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_ws.py", line 472, in receive
    await self.pong(msg.data)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_ws.py", line 329, in pong
    await self._writer.pong(message)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 709, in pong
    await self._send_frame(message, WSMsgType.PONG)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 682, in _send_frame
    self._write(header + message)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 702, in _write
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport

Hi, I have similar issue, as reported in this topic

Do you have also similar issues in the Supervisor and Host logs? I also find errors in other logs, like these are from Node-Red

24 Dec 14:40:30 - [info] [server:Home Assistant] Connection closed to http://supervisor/core
24 Dec 14:40:35 - [info] [server:Home Assistant] Connecting to http://supervisor/core
24 Dec 14:40:35 - [info] [server:Home Assistant] Connected to http://supervisor/core
24 Dec 14:42:49 - [info] [server:Home Assistant] Connection closed to http://supervisor/core
24 Dec 14:42:54 - [info] [server:Home Assistant] Connecting to http://supervisor/core
24 Dec 14:42:54 - [info] [server:Home Assistant] Connected to http://supervisor/core
24 Dec 14:45:09 - [info] [server:Home Assistant] Connection closed to http://supervisor/core
24 Dec 14:45:14 - [info] [server:Home Assistant] Connecting to http://supervisor/core
24 Dec 14:45:14 - [info] [server:Home Assistant] Connected to http://supervisor/core

I cannot fully understand if is strictly network related, or if something in my HA installation kept restarting automatically every few minutes.

I will try the radio off suggestion in the meantime.