Skip to content

Websocket: Invalid response status 502 #2540

@mietzen

Description

@mietzen

What happened?

AppDaemon regularly looses the websocket connections. I already set:

      ws_timeout: 120
      ws_max_msg_size: 0

But I still get restarts / reconnects. I also attached Supervisor and Core logs. Is this a AppDaemon or Home Assistant issue?

Version

4.5.13

Installation type

Home Assistant add-on

Relevant log output

2026-02-17 05:15:23.727726 ERROR HASS: 502, message='Invalid response status', url='http://supervisor/core/api/websocket'
2026-02-17 05:15:23.729585 INFO HASS: Attempting reconnection in 5.0s
2026-02-17 05:15:59.727350 ERROR HASS: 502, message='Invalid response status', url='http://supervisor/core/api/websocket'
2026-02-17 05:15:59.729132 INFO HASS: Attempting reconnection in 5.0s
2026-02-17 05:16:13.936108 INFO HASS: Connected to Home Assistant 2026.2.2 with aiohttp websocket
2026-02-17 05:16:13.942317 INFO HASS: Authenticated to Home Assistant 2026.2.2
2026-02-17 05:16:13.962300 INFO HASS: Waiting for Home Assistant to start
2026-02-17 05:16:14.113051 INFO HASS: Completed initialization in 9.4s
2026-02-17 05:16:14.523035 INFO AppDaemon: Processing restart for plugin namespace 'default'

Edit:

Some times it's also:

2026-02-17 07:49:36.711184 ERROR HASS: Websocket connection lost
2026-02-17 07:49:36.713205 INFO HASS: Attempting reconnection in 5.0s
2026-02-17 07:49:37.148823 INFO AppDaemon: Stopping apps from namespace 'default' because the plugin failed
2026-02-17 07:49:37.154396 INFO AppDaemon: Stopping apps: ...
2026-02-17 07:50:13.319457 ERROR HASS: 502, message='Invalid response status', url='http://supervisor/core/api/websocket'
2026-02-17 07:50:13.321360 INFO HASS: Attempting reconnection in 5.0s
2026-02-17 07:50:40.229685 INFO HASS: Connected to Home Assistant 2026.2.2 with aiohttp websocket
2026-02-17 07:50:40.239850 INFO HASS: Authenticated to Home Assistant 2026.2.2

Relevant code in the app or config file that caused the issue

Anything else?

Supervisor log:

2026-02-17 05:14:47.705 WARNING (MainThread) [supervisor.api.proxy] [a0d7b954_appdaemon] Error WebSocket message received while proxying: ServerTimeoutError('No PONG received after 15.0 seconds')
2026-02-17 05:14:47.710 INFO (MainThread) [supervisor.api.proxy] [a0d7b954_appdaemon] Home Assistant WebSocket API closed
2026-02-17 05:15:47.705 WARNING (MainThread) [supervisor.misc.tasks] Watchdog missed an Home Assistant Core API response.
2026-02-17 05:16:13.635 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request initialize
2026-02-17 05:16:13.939 INFO (MainThread) [supervisor.api.proxy] WebSocket access from a0d7b954_appdaemon
2026-02-17 05:16:13.953 INFO (MainThread) [supervisor.api.proxy] [a0d7b954_appdaemon] Home Assistant WebSocket API proxy running

Core log:

2026-02-17 05:14:10.303 ERROR (MainThread) [homeassistant.components.fritzbox] Error fetching 01KHJWR7A6SY20H2C85DNF6KHD data:
2026-02-17 05:15:39.165 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection] [140408364240864] Supervisor from 172.30.32.2 (HomeAssistantSupervisor/2026.02.2 aiohttp/3.13.3 Python/3.13): Disconnected: Received error message during command phase: Cannot write to closing transport
2026-02-17 05:15:41.187 ERROR (MainThread) [paho.mqtt.client] failed to receive on socket: [Errno 32] Broken pipe
2026-02-17 05:16:07.608 WARNING (MainThread) [homeassistant.components.mqtt.client] Error returned from MQTT server: The connection was lost.
2026-02-17 05:16:12.883 WARNING (MainThread) [homeassistant.components.automation.update_unavailable] System - Refresh sensor.unavailable: Already running
2026-02-17 05:16:13.498 WARNING (MainThread) [homeassistant.components.mqtt.client] No ACK from MQTT server in 10 seconds (mid: 86)

Metadata

Metadata

Assignees

No one assigned

    Labels

    issueSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions