{"record":{"id":"be7a788cc7db698a","repo":"AlexxIT/go2rtc","slug":"can-t-find-consumer","errorCode":null,"errorMessage":"can't find consumer","messagePattern":"can't find consumer","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/streams/play.go","lineNumber":108,"sourceCode":"\n\t\tgo func() {\n\t\t\t_ = dst.Start()\n\t\t\t_ = src.Stop()\n\t\t\ts.RemoveInternalConsumer(cons)\n\t\t}()\n\n\t\tgo func() {\n\t\t\t_ = src.Start()\n\t\t\t// little timeout before stop dst, so the buffer can be transferred\n\t\t\ttime.Sleep(time.Second)\n\t\t\t_ = dst.Stop()\n\t\t\ts.RemoveProducer(src)\n\t\t}()\n\n\t\treturn nil\n\t}\n\n\treturn errors.New(\"can't find consumer\")\n}\n\nfunc (s *Stream) AddInternalProducer(conn core.Producer) {\n\tproducer := &Producer{conn: conn, state: stateInternal, url: \"internal\"}\n\ts.mu.Lock()\n\ts.producers = append(s.producers, producer)\n\ts.mu.Unlock()\n}\n\nfunc (s *Stream) AddInternalConsumer(conn core.Consumer) {\n\ts.mu.Lock()\n\ts.consumers = append(s.consumers, conn)\n\ts.mu.Unlock()\n}\n\nfunc (s *Stream) RemoveInternalConsumer(conn core.Consumer) {\n\ts.mu.Lock()\n\tfor i, consumer := range s.consumers {","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/internal/streams/play.go#L90-L126","documentation":"Play returns this when it cannot find the internal consumer it needs to bridge an external producer into the stream — the loop over the stream's consumers ended without a match. It is a lookup failure inside the swap/replay logic, typically because the expected internal consumer was already removed or never added.","triggerScenarios":"Thrown at internal/streams/play.go:108 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the internal consumer was added before Play is called and not concurrently removed","Guard Play calls with the stream mutex or check stream state first","Retry the play operation after re-adding the consumer"],"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"}