Summary
Go2RtcRestClient.streams.list() raises Go2RtcClientError whenever any stream in go2rtc has a producer that was pushed into it (WHIP ingest / WebRTC push). Pushed producers have no "url" key in the /api/streams payload — there is no source URL, the media was pushed — but Producer.url is declared required, so one pushed stream anywhere makes the entire streams list undecodable.
Impact (how this surfaces in Home Assistant)
With go2rtc: url: pointing HA at a go2rtc instance that also receives WHIP publishes (e.g. kiosk tablets publishing their cameras via browser_mod's go2rtc mode), every code path in the go2rtc integration that calls streams.list() fails while a publisher is connected:
async_get_image → every camera still image in the instance returns 500 (all cameras, not just the pushed stream)
ws_webrtc_offer → WebRTC playback offers fail
The failure is intermittent-looking (it tracks whether a publisher is currently connected), which made it painful to diagnose.
Actual payload from go2rtc v1.9.14
Producer entry for a WHIP-published stream — note there is no url key:
{
"id": 4439,
"format_name": "webrtc",
"protocol": "http+udp",
"remote_addr": "192.168.10.212:59793 host",
"user_agent": "Mozilla/5.0 (Linux; Android 8.1.0; ...; wv) ... Chrome/138.0.7204.181 Safari/537.36",
"medias": ["video, recvonly, H264", "video, sendonly, VP8, VP9, H264"],
"receivers": [{"id": 4440, "codec": {"codec_name": "h264", "codec_type": "video"}, "childs": [4447, 4456], "bytes": 37630084, "packets": 34687}],
"bytes_recv": 38330115
}
Traceback (HA 2026.7.2, go2rtc-client 0.4.0)
mashumaro.exceptions.MissingField: Field "url" of type str is missing in Producer instance
During handling of the above exception, another exception occurred:
...
File ".../go2rtc_client/rest.py", line 141, in list
return _GET_STREAMS_DECODER.decode(await resp.json())
mashumaro.exceptions.InvalidFieldValue: Field "producers" of type list[Producer] in Stream has invalid value [...]
The above exception was the direct cause of the following exception:
...
File ".../homeassistant/components/go2rtc/__init__.py", line 408, in _update_stream_source
streams = await self._rest_client.streams.list()
go2rtc_client.exceptions.Go2RtcClientError
Reproduction
- Run go2rtc with a declared stream, e.g.
streams: { "kiosk": }.
- Publish into it via WHIP (
POST /api/webrtc?dst=kiosk from any browser, OBS, etc.).
await client.streams.list() → Go2RtcClientError.
Fix
Make Producer.url optional (str | None = None), matching what go2rtc actually reports. Same category as #21, which handled producers itself being null. PR incoming.
Summary
Go2RtcRestClient.streams.list()raisesGo2RtcClientErrorwhenever any stream in go2rtc has a producer that was pushed into it (WHIP ingest / WebRTC push). Pushed producers have no"url"key in the/api/streamspayload — there is no source URL, the media was pushed — butProducer.urlis declared required, so one pushed stream anywhere makes the entire streams list undecodable.Impact (how this surfaces in Home Assistant)
With
go2rtc: url:pointing HA at a go2rtc instance that also receives WHIP publishes (e.g. kiosk tablets publishing their cameras via browser_mod's go2rtc mode), every code path in the go2rtc integration that callsstreams.list()fails while a publisher is connected:async_get_image→ every camera still image in the instance returns 500 (all cameras, not just the pushed stream)ws_webrtc_offer→ WebRTC playback offers failThe failure is intermittent-looking (it tracks whether a publisher is currently connected), which made it painful to diagnose.
Actual payload from go2rtc v1.9.14
Producer entry for a WHIP-published stream — note there is no
urlkey:{ "id": 4439, "format_name": "webrtc", "protocol": "http+udp", "remote_addr": "192.168.10.212:59793 host", "user_agent": "Mozilla/5.0 (Linux; Android 8.1.0; ...; wv) ... Chrome/138.0.7204.181 Safari/537.36", "medias": ["video, recvonly, H264", "video, sendonly, VP8, VP9, H264"], "receivers": [{"id": 4440, "codec": {"codec_name": "h264", "codec_type": "video"}, "childs": [4447, 4456], "bytes": 37630084, "packets": 34687}], "bytes_recv": 38330115 }Traceback (HA 2026.7.2, go2rtc-client 0.4.0)
Reproduction
streams: { "kiosk": }.POST /api/webrtc?dst=kioskfrom any browser, OBS, etc.).await client.streams.list()→Go2RtcClientError.Fix
Make
Producer.urloptional (str | None = None), matching what go2rtc actually reports. Same category as #21, which handledproducersitself being null. PR incoming.