{"record":{"id":"d46efc132f632d44","repo":"AlexxIT/go2rtc","slug":"streams-stream-not-found-s","errorCode":null,"errorMessage":"streams: stream not found: %s","messagePattern":"streams: stream not found: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/streams/preload.go","lineNumber":40,"sourceCode":"\tif rawQuery == \"\" {\n\t\trawQuery = \"video&audio\"\n\t}\n\n\tquery, err := url.ParseQuery(rawQuery)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tpreloadsMu.Lock()\n\tdefer preloadsMu.Unlock()\n\n\tif p := preloads[name]; p != nil {\n\t\tp.stream.RemoveConsumer(p.Cons)\n\t}\n\n\tstream := Get(name)\n\tif stream == nil {\n\t\treturn fmt.Errorf(\"streams: stream not found: %s\", name)\n\t}\n\tcons := probe.Create(\"preload\", query)\n\n\tif err = stream.AddConsumer(cons); err != nil {\n\t\treturn err\n\t}\n\n\tpreloads[name] = &Preload{stream: stream, Cons: cons, Query: rawQuery}\n\treturn nil\n}\n\nfunc DelPreload(name string) error {\n\tpreloadsMu.Lock()\n\tdefer preloadsMu.Unlock()\n\n\tif p := preloads[name]; p != nil {\n\t\tp.stream.RemoveConsumer(p.Cons)\n\t\tdelete(preloads, name)","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/internal/streams/preload.go#L22-L58","documentation":"AddPreload guard: streams.Get(name) returned nil, so the stream named in the preload config (name interpolated) does not exist — a preload can only attach a probe consumer to an already-created stream, it never creates one. Fired from config preload at startup or via the API.","triggerScenarios":"Thrown at internal/streams/preload.go:40 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the preload name to match a configured stream","Ensure the stream is created (config sources) before preload runs","Create the stream first via the API, then call AddPreload"],"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"}