Ingress dies on Supervisor [ConnectionResetError: Cannot write to closing transport]

I’m appealing for some help to diagnose why ingress on my HA installation keeps dying.

After ingress from the supervisor dies, HA still appears to run correctly, but all add-ons become unavailable. The only way to resolve the problem is to ssh to the host and run ha supervisor restart or to restart the host OS from the GUI.

After chasing the problem for a very long time, I finally have captured some useful log information. The problem seems to begin with the supervisor encountering
ConnectionResetError: Cannot write to closing transport.

[32m2024-08-13 18:32:05.702 INFO (MainThread) [supervisor.resolution.check] Starting system checks with state runninge[0m
e[32m2024-08-13 18:32:05.703 INFO (MainThread) [supervisor.resolution.checks.base] Run check for ipv4_connection_problem/systeme[0m
e[32m2024-08-13 18:32:05.703 INFO (MainThread) [supervisor.resolution.checks.base] Run check for multiple_data_disks/systeme[0m
e[32m2024-08-13 18:32:05.703 INFO (MainThread) [supervisor.resolution.checks.base] Run check for security/coree[0m
e[32m2024-08-13 18:32:05.704 INFO (MainThread) [supervisor.resolution.checks.base] Run check for disabled_data_disk/systeme[0m
e[32m2024-08-13 18:32:05.704 INFO (MainThread) [supervisor.resolution.checks.base] Run check for dns_server_ipv6_error/dns_servere[0m
e[32m2024-08-13 18:32:05.705 INFO (MainThread) [supervisor.resolution.checks.base] Run check for dns_server_failed/dns_servere[0m
e[32m2024-08-13 18:32:05.705 INFO (MainThread) [supervisor.resolution.checks.base] Run check for no_current_backup/systeme[0m
e[32m2024-08-13 18:32:05.705 INFO (MainThread) [supervisor.resolution.checks.base] Run check for pwned/addone[0m
e[32m2024-08-13 18:32:05.706 INFO (MainThread) [supervisor.resolution.checks.base] Run check for trust/supervisore[0m
e[32m2024-08-13 18:32:05.713 INFO (MainThread) [supervisor.resolution.checks.base] Run check for free_space/systeme[0m
e[32m2024-08-13 18:32:05.714 INFO (MainThread) [supervisor.resolution.checks.base] Run check for docker_config/systeme[0m
e[32m2024-08-13 18:32:05.714 INFO (MainThread) [supervisor.resolution.check] System checks completee[0m
e[32m2024-08-13 18:32:05.714 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state runninge[0m
e[32m2024-08-13 18:32:05.776 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation completee[0m
e[32m2024-08-13 18:32:05.777 INFO (MainThread) [supervisor.resolution.fixup] Starting system autofix at state runninge[0m
e[32m2024-08-13 18:32:05.777 INFO (MainThread) [supervisor.resolution.fixup] System autofix completee[0m
e[32m2024-08-13 18:32:33.860 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API tokene[0m
e[31m2024-08-13 18:44:54.294 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 189, in block_bad_requests
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 205, in system_validation
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 224, in token_validation
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 283, in core_proxy
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/ingress.py", line 161, in handler
    return await self._handle_websocket(request, addon, path, session_data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/api/ingress.py", line 190, in _handle_websocket
    await ws_server.prepare(request)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_ws.py", line 152, in prepare
    payload_writer = await super().prepare(request)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_response.py", line 417, in prepare
    return await self._start(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_response.py", line 425, in _start
    await self._write_headers()
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_response.py", line 505, in _write_headers
    await writer.write_headers(status_line, self._headers)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/http_writer.py", line 130, in write_headers
    self._write(buf)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/http_writer.py", line 75, in _write
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transporte[0m
  • The above error occurs 22 times in the log file, and then HA is restarted. However when HA comes up again the supervisor seems to fail to establish contact with it as the supervisor log continually repeats the error
    Timeout on call http://172.30.32.1:8123/api/core/state
[32m2024-08-13 18:45:08.289 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/info access from cebe7a76_hassio_google_drive_backupe[0m
e[32m2024-08-13 18:45:08.293 INFO (MainThread) [supervisor.api.middleware.security] /backups access from cebe7a76_hassio_google_drive_backupe[0m
e[31m2024-08-13 18:45:27.437 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:47:04.436 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[33m2024-08-13 18:47:04.437 WARNING (MainThread) [supervisor.misc.tasks] Watchdog missed an Home Assistant Core API response.e[0m
e[33m2024-08-13 18:47:06.438 WARNING (MainThread) [supervisor.misc.tasks] Watchdog/Application found a problem with observer plugin!e[0m
e[32m2024-08-13 18:47:06.445 INFO (SyncWorker_7) [supervisor.docker.manager] Stopping hassio_observer applicatione[0m
e[32m2024-08-13 18:47:06.621 INFO (SyncWorker_7) [supervisor.docker.manager] Cleaning hassio_observer applicatione[0m
e[32m2024-08-13 18:47:06.657 INFO (MainThread) [supervisor.plugins.observer] Starting observer plugine[0m
e[32m2024-08-13 18:47:07.010 INFO (MainThread) [supervisor.docker.observer] Starting Observer ghcr.io/home-assistant/amd64-hassio-observer with version 2023.06.0 - 172.30.32.6e[0m
e[31m2024-08-13 18:47:08.437 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:49:35.438 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:49:35.438 ERROR (MainThread) [supervisor.misc.tasks] Watchdog missed 2 Home Assistant Core API responses in a row. Restarting Home Assistant Core!e[0m
e[32m2024-08-13 18:49:35.445 INFO (SyncWorker_3) [supervisor.docker.manager] Restarting homeassistante[0m
e[32m2024-08-13 18:49:35.518 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API for a0d7b954_nodered closede[0m
e[31m2024-08-13 18:49:35.519 ERROR (MainThread) [supervisor.homeassistant.api] Error on call http://172.30.32.1:8123/api/core/state: Cannot connect to host 172.30.32.1:8123 ssl:False [Connect call failed ('172.30.32.1', 8123)]e[0m
e[32m2024-08-13 18:49:35.520 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API for a0d7b954_vscode closede[0m
e[31m2024-08-13 18:49:54.438 ERROR (MainThread) [aiohttp.server] Error handling requeste[0m
e[31m2024-08-13 18:49:54.438 ERROR (MainThread) [aiohttp.server] Error handling requeste[0m
e[31m2024-08-13 18:50:05.442 ERROR (MainThread) [aiohttp.server] Error handling requeste[0m
e[32m2024-08-13 18:50:12.967 INFO (MainThread) [supervisor.homeassistant.core] Wait until Home Assistant is readye[0m
e[32m2024-08-13 18:50:14.788 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state runninge[0m
e[32m2024-08-13 18:50:14.859 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation completee[0m
e[33m2024-08-13 18:50:17.436 WARNING (MainThread) [supervisor.misc.tasks] Watchdog/Application found a problem with observer plugin!e[0m
e[32m2024-08-13 18:50:17.439 INFO (SyncWorker_1) [supervisor.docker.manager] Stopping hassio_observer applicatione[0m
e[32m2024-08-13 18:50:17.657 INFO (SyncWorker_1) [supervisor.docker.manager] Cleaning hassio_observer applicatione[0m
e[32m2024-08-13 18:50:17.692 INFO (MainThread) [supervisor.plugins.observer] Starting observer plugine[0m
e[32m2024-08-13 18:50:18.058 INFO (MainThread) [supervisor.docker.observer] Starting Observer ghcr.io/home-assistant/amd64-hassio-observer with version 2023.06.0 - 172.30.32.6e[0m
e[31m2024-08-13 18:50:39.437 ERROR (MainThread) [aiohttp.server] Error handling requeste[0m
e[31m2024-08-13 18:50:41.438 ERROR (MainThread) [aiohttp.server] Error handling requeste[0m
e[31m2024-08-13 18:50:45.437 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
[31m2024-08-13 18:50:46.437 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:50:48.438 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:50:48.439 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:50:48.439 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:50:48.439 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:50:48.439 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:50:48.440 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:50:48.440 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:50:48.440 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:50:58.438 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:51:17.437 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:51:20.437 ERROR (MainThread) [aiohttp.server] Error handling requeste[0m
e[31m2024-08-13 18:51:22.437 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:51:22.440 ERROR (MainThread) [aiohttp.server] Error handling requeste[0m
e[31m2024-08-13 18:51:24.438 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:51:49.438 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:51:58.438 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:52:00.437 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:52:03.437 ERROR (MainThread) [aiohttp.server] Error handling requeste[0m
e[31m2024-08-13 18:52:03.438 ERROR (MainThread) [aiohttp.server] Error handling requeste[0m
e[31m2024-08-13 18:52:25.437 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:52:34.436 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:52:36.438 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:52:43.437 ERROR (MainThread) [aiohttp.server] Error handling requeste[0m
e[31m2024-08-13 18:52:44.436 ERROR (MainThread) [aiohttp.server] Error handling requeste[0m
e[31m2024-08-13 18:52:57.438 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:53:10.437 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:53:12.439 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:53:24.437 ERROR (MainThread) [aiohttp.server] Error handling requeste[0m
e[31m2024-08-13 18:53:26.437 ERROR (MainThread) [aiohttp.server] Error handling requeste[0m
e[33m2024-08-13 18:53:28.438 WARNING (MainThread) [supervisor.misc.tasks] Watchdog/Application found a problem with observer plugin!e[0m
e[32m2024-08-13 18:53:28.445 INFO (SyncWorker_1) [supervisor.docker.manager] Stopping hassio_observer applicatione[0m
e[32m2024-08-13 18:53:28.625 INFO (SyncWorker_1) [supervisor.docker.manager] Cleaning hassio_observer applicatione[0m
e[32m2024-08-13 18:53:28.662 INFO (MainThread) [supervisor.plugins.observer] Starting observer plugine[0m
e[32m2024-08-13 18:53:29.011 INFO (MainThread) [supervisor.docker.observer] Starting Observer ghcr.io/home-assistant/amd64-hassio-observer with version 2023.06.0 - 172.30.32.6e[0m
e[31m2024-08-13 18:53:29.438 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:53:46.437 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:53:48.438 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:53:48.439 ERROR (MainThread) [supervisor.homeassistant.core] No Home Assistant Core response, assuming a fatal startup errore[0m
e[31m2024-08-13 18:53:48.439 ERROR (MainThread) [supervisor.misc.tasks] Home Assistant watchdog reanimation failed!e[0m
e[31m2024-08-13 18:53:59.437 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:53:59.437 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:53:59.438 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:53:59.438 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:53:59.438 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:53:59.438 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:53:59.439 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m
e[31m2024-08-13 18:54:01.438 ERROR (MainThread) [supervisor.homeassistant.api] Timeout on call http://172.30.32.1:8123/api/core/state.e[0m

Below is the log from HA around the same time where I think everything looks fine except for one odd thing that I can’t explain which is that this message from HA:
s6-rc: info: service legacy-services: stopping at 18:48:58.033
occurs before the supervisor log message:
[supervisor.docker.manager] Restarting homeassistant at 18:49:35.445.
This oddity is quite a bit after the initial problems that the supervisor encountered, so I’m inclined not to read too much into it.

[32m2024-08-13 18:42:58.019 INFO (MainThread) [habluetooth.scanner] hci0 (00:A5:54:3F:C0:59): Bluetooth scanner has gone quiet for 90s, restartinge[0m
e[32m2024-08-13 18:44:58.025 INFO (MainThread) [habluetooth.scanner] hci0 (00:A5:54:3F:C0:59): Bluetooth scanner has gone quiet for 90s, restartinge[0m
e[32m2024-08-13 18:45:00.339 INFO (MainThread) [homeassistant.components.automation.unavailable_entities_notification] Unavailable Entities Notification: Running automation actionse[0m
e[32m2024-08-13 18:45:00.341 INFO (MainThread) [homeassistant.components.automation.unavailable_entities_notification] Unavailable Entities Notification: Choose at step 1: choice 2: Running automation actionse[0m
e[32m2024-08-13 18:45:00.341 INFO (MainThread) [homeassistant.components.automation.unavailable_entities_notification] Unavailable Entities Notification: Choose at step 1: choice 2: Executing step call servicee[0m
e[32m2024-08-13 18:48:58.033 INFO (MainThread) [habluetooth.scanner] hci0 (00:A5:54:3F:C0:59): Bluetooth scanner has gone quiet for 90s, restartinge[0m
s6-rc: info: service legacy-services: stopping
e[32m2024-08-13 18:49:35.489 INFO (MainThread) [homeassistant.components.netatmo.data_handler] Netatmo webhook unregisterede[0m
e[32m2024-08-13 18:49:35.507 INFO (MainThread) [dsmr_parser.clients.protocol] disconnected because of close/abort.e[0m
e[32m2024-08-13 18:50:00.339 INFO (MainThread) [homeassistant.components.automation.unavailable_entities_notification] Unavailable Entities Notification: Running automation actionse[0m
e[32m2024-08-13 18:50:00.340 INFO (MainThread) [homeassistant.components.automation.unavailable_entities_notification] Unavailable Entities Notification: Choose at step 1: choice 2: Running automation actionse[0m
e[32m2024-08-13 18:50:00.340 INFO (MainThread) [homeassistant.components.automation.unavailable_entities_notification] Unavailable Entities Notification: Choose at step 1: choice 2: Executing step call servicee[0m
e[31m2024-08-13 18:50:07.440 ERROR (MainThread) [aiohttp.server] Unhandled exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 459, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 537, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/hassio/ingress.py", line 94, in _handle
    return await self._handle_websocket(request, token, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/hassio/ingress.py", line 146, in _handle_websocket
    await asyncio.wait(
  File "/usr/local/lib/python3.12/asyncio/tasks.py", line 464, in wait
    return await _wait(fs, timeout, return_when, loop)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/tasks.py", line 550, in _wait
    await waiter
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 540, in start
    resp, reset = await task
                  ^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 486, in _handle_request
    self._handler_waiter.set_result(None)
asyncio.exceptions.InvalidStateError: invalid statee[0m
e[31m2024-08-13 18:50:07.450 ERROR (MainThread) [aiohttp.server] Unhandled exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 459, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 537, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/hassio/ingress.py", line 94, in _handle
    return await self._handle_websocket(request, token, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/hassio/ingress.py", line 146, in _handle_websocket
    await asyncio.wait(
  File "/usr/local/lib/python3.12/asyncio/tasks.py", line 464, in wait
    return await _wait(fs, timeout, return_when, loop)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/tasks.py", line 550, in _wait
    await waiter
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 540, in start
    resp, reset = await task
                  ^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 486, in _handle_request
    self._handler_waiter.set_result(None)
asyncio.exceptions.InvalidStateError: invalid statee[0m
[16:50:09] INFO: e[32mHome Assistant Core finish process exit code 0e[0m
[16:50:09] INFO: e[32mHome Assistant Core service shutdowne[0m
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun home-assistant (no readiness notification)
s6-rc: info: service legacy-services successfully started

Here is some additional background information:

  • I’ve experienced this problem for a long time (Maybe as long as I’ve been running HA: 1 year+?) but it only occurs maybe 2-3 times per month.
  • I’ve recently migrated from an RPI4 4GB to an Intel N100 with 16GB RAM which was a huge performance boost but this problem migrated with me. I run quite a few containers but utilisation on the machine looks fine.
  • Below is an example of what I see in a browser or on the mobile app when I try to access an add-on in HA:

I would greatly appreciate any advice from Home Assistant experts out there!