{"record":{"id":"2ab2f3d7b500da5e","repo":"AlexxIT/go2rtc","slug":"streams-unknown-error","errorCode":null,"errorMessage":"streams: unknown error","messagePattern":"streams: unknown error","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/streams/add_consumer.go","lineNumber":155,"sourceCode":"\t\t\t\tfor _, codec := range media.Codecs {\n\t\t\t\t\tprod = appendString(prod, media.Kind+\":\"+codec.PrintName())\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor _, media := range consMedias {\n\t\t\tif media.Direction == core.DirectionSendonly {\n\t\t\t\tfor _, codec := range media.Codecs {\n\t\t\t\t\tcons = appendString(cons, media.Kind+\":\"+codec.PrintName())\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn errors.New(\"streams: codecs not matched: \" + prod + \" => \" + cons)\n\t}\n\n\t// 3. Return unknown error\n\treturn errors.New(\"streams: unknown error\")\n}\n\nfunc appendString(s, elem string) string {\n\tif strings.Contains(s, elem) {\n\t\treturn s\n\t}\n\tif len(s) == 0 {\n\t\treturn elem\n\t}\n\treturn s + \", \" + elem\n}\n","sourceCodeStart":137,"sourceCodeEnd":167,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/internal/streams/add_consumer.go#L137-L167","documentation":"Catch-all returned by formatError in AddConsumer when codec negotiation failed but the underlying error matched none of the known cases (step 3 after specific cases are exhausted). It means the exact cause could not be classified, so the real reason must be dug out of logs or the peer connection state.","triggerScenarios":"Thrown at internal/streams/add_consumer.go:155 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect preceding log lines and the WebRTC/RTSP peer state to find the true negotiation failure","Retry AddConsumer against a fresh producer connection","Report the case upstream so formatError can classify it"],"exampleFix":null,"handlingStrategy":"fallback","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"}