{"record":{"id":"7fa1dc9b7d1468f3","repo":"AlexxIT/go2rtc","slug":"webrtc-stream-not-found-7fa1dc","errorCode":null,"errorMessage":"webrtc: stream not found","messagePattern":"webrtc: stream not found","errorType":"exception","errorClass":null,"httpStatus":404,"severity":"error","filePath":"internal/webtorrent/init.go","lineNumber":48,"sourceCode":"\n\tapp.LoadConfig(&cfg)\n\n\tif len(cfg.Mod.Trackers) == 0 {\n\t\treturn\n\t}\n\n\tlog = app.GetLogger(\"webtorrent\")\n\n\tstreams.HandleFunc(\"webtorrent\", streamHandle)\n\n\tapi.HandleFunc(\"api/webtorrent\", apiHandle)\n\n\tsrv = &webtorrent.Server{\n\t\tURL: cfg.Mod.Trackers[0],\n\t\tExchange: func(src, offer string) (answer string, err error) {\n\t\t\tstream := streams.Get(src)\n\t\t\tif stream == nil {\n\t\t\t\treturn \"\", errors.New(api.StreamNotFound)\n\t\t\t}\n\t\t\treturn webrtc.ExchangeSDP(stream, offer, \"webtorrent\", \"\")\n\t\t},\n\t}\n\n\tif log.Debug().Enabled() {\n\t\tsrv.Listen(func(msg any) {\n\t\t\tswitch msg.(type) {\n\t\t\tcase string, error:\n\t\t\t\tlog.Debug().Msgf(\"[webtorrent] %s\", msg)\n\t\t\tcase *webtorrent.Message:\n\t\t\t\tlog.Trace().Any(\"msg\", msg).Msgf(\"[webtorrent]\")\n\t\t\t}\n\t\t})\n\t}\n\n\tfor name, share := range cfg.Mod.Shares {\n\t\tif len(name) < 8 {","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/internal/webtorrent/init.go#L30-L66","documentation":"Webtorrent tracker Exchange callback guard: the tracker requested an SDP exchange for a stream name that streams.Get cannot find (nil), so api.StreamNotFound ('webrtc: stream not found') is returned to the tracker. It means the share/announce referenced an unknown source, not that WebRTC itself failed.","triggerScenarios":"Thrown at internal/webtorrent/init.go:48 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the stream exists and is running before peers try to fetch it via the tracker","Check the stream name embedded in the webtorrent share URL/announce","Re-add or preload the missing stream, then let the peer retry the exchange"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c245815e75e2a5fd60b4290f12bfc04e55a984d3","analyzedAt":"2026-09-07T11:47:02.965Z","contentChangedAt":"2026-09-07T11:47:02.965Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}