{"record":{"id":"8fcb2f6f0d8a662d","repo":"AlexxIT/go2rtc","slug":"streams-preload-not-found-s","errorCode":null,"errorMessage":"streams: preload not found: %s","messagePattern":"streams: preload not found: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/streams/preload.go","lineNumber":62,"sourceCode":"\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)\n\t\treturn nil\n\t}\n\n\treturn fmt.Errorf(\"streams: preload not found: %s\", name)\n}\n\nfunc GetPreloads() map[string]*Preload {\n\tpreloadsMu.Lock()\n\tdefer preloadsMu.Unlock()\n\treturn maps.Clone(preloads)\n}\n","sourceCodeStart":44,"sourceCodeEnd":70,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/internal/streams/preload.go#L44-L70","documentation":"DelPreload fails when the named preload does not exist in the preloads registry: the map lookup for name returns nil, so no consumer is removed and the function reports the unknown name. Fires when API callers (apiPreload) request deletion of a stream preload that was never added or was already deleted.","triggerScenarios":"Thrown at internal/streams/preload.go:62 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the preload name matches one created earlier with AddPreload","Check whether the preload was already removed by a prior DelPreload call","List existing preloads with GetPreloads before deleting"],"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"}