{"record":{"id":"02eb233c941655d3","repo":"AlexxIT/go2rtc","slug":"stream-not-found","errorCode":null,"errorMessage":"stream not found: ","messagePattern":"stream not found: ","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/rtmp/rtmp.go","lineNumber":82,"sourceCode":"\t\t}\n\t}()\n}\n\nfunc tcpHandle(netConn net.Conn) error {\n\trtmpConn, err := rtmp.NewServer(netConn)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err = rtmpConn.ReadCommands(); err != nil {\n\t\treturn err\n\t}\n\n\tswitch rtmpConn.Intent {\n\tcase rtmp.CommandPlay:\n\t\tstream := streams.Get(rtmpConn.App)\n\t\tif stream == nil {\n\t\t\treturn errors.New(\"stream not found: \" + rtmpConn.App)\n\t\t}\n\n\t\tcons := flv.NewConsumer()\n\t\tif err = stream.AddConsumer(cons); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tdefer stream.RemoveConsumer(cons)\n\n\t\tif err = rtmpConn.WriteStart(); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t_, _ = cons.WriteTo(rtmpConn)\n\n\t\treturn nil\n\n\tcase rtmp.CommandPublish:","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/internal/rtmp/rtmp.go#L64-L100","documentation":"In the RTMP server's tcpHandle, a CommandPlay intent looks up the stream by the RTMP app name via streams.Get. If no stream exists, the library returns \"stream not found: <app>\", refusing playback because there is no producer to feed the FLV consumer.","triggerScenarios":"An RTMP client (player) connects and sends play with an app/stream name that doesn't match any configured go2rtc stream; streams.Get(rtmpConn.App) returns nil.","commonSituations":"Publishing/playing to rtmp://host/live/name where \"name\" isn't configured in go2rtc.yaml, players using a different stream key than configured, or the stream being removed at runtime.","solutions":["Configure the requested stream name in go2rtc.yaml streams section before playing","Align the RTMP URL/stream key with an existing stream name","Create the stream dynamically via the streams API before the RTMP play","Check client logs for the exact app name and compare to configured names"],"exampleFix":"// before\nrtmp://host:1935/live/unknown_stream\n// after (go2rtc.yaml)\nstreams:\n  unknown_stream: rtsp://camera/...","handlingStrategy":"validation","validationCode":"// Before RTMP play, verify the stream is configured\ncurl -f http://host:1984/api/streams | grep <stream-name>","typeGuard":null,"tryCatchPattern":"// Client side\nif err := playRTMP(url); err != nil {\n    if strings.HasPrefix(err.Error(), \"stream not found\") {\n        log.Fatalf(\"configure stream %q in go2rtc first\", appName)\n    }\n}","preventionTips":["Ensure every RTMP playback name has a streams entry in go2rtc.yaml","Use consistent naming between RTMP URLs and stream config","Create streams via API before automated players start"],"tags":["rtmp","play","stream-not-found"],"backgroundTag":"stream-not-found","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"}