{"record":{"id":"cc1be5e36986556d","repo":"AlexxIT/go2rtc","slug":"rtmp-unknown-command","errorCode":null,"errorMessage":"rtmp: unknown command: ","messagePattern":"rtmp: unknown command: ","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/rtmp/rtmp.go","lineNumber":124,"sourceCode":"\t\tif err = rtmpConn.WriteStart(); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tprod, err := rtmpConn.Producer()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tstream.AddProducer(prod)\n\n\t\tdefer stream.RemoveProducer(prod)\n\n\t\t_ = prod.Start()\n\n\t\treturn nil\n\t}\n\n\treturn errors.New(\"rtmp: unknown command: \" + rtmpConn.Intent)\n}\n\nvar log zerolog.Logger\n\nfunc streamsHandle(url string) (core.Producer, error) {\n\treturn rtmp.DialPlay(url)\n}\n\nfunc streamsConsumerHandle(url string) (core.Consumer, func(), error) {\n\tcons := flv.NewConsumer()\n\trun := func() {\n\t\twr, err := rtmp.DialPublish(url, cons)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\t_, err = cons.WriteTo(wr)\n\t}\n","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/internal/rtmp/rtmp.go#L106-L142","documentation":"After handling CommandPlay and CommandPublish, the RTMP server's tcpHandle treats any other rtmpConn.Intent as unsupported and returns \"rtmp: unknown command: <intent>\". The library only implements play and publish for incoming RTMP connections.","triggerScenarios":"An RTMP client sends an intent/command other than play or publish (custom or malformed handshake state), so the switch statement falls through to the default error return at internal/rtmp/rtmp.go:124.","commonSituations":"Non-standard RTMP clients or fuzzers sending unexpected commands, a client library setting a custom intent value, or protocol-level misbehavior after handshake.","solutions":["Use a standard RTMP client that issues only play or publish commands","Update the client library to a conforming RTMP implementation","Inspect the intent value in the error to identify the offending client","If you need more commands, patch the RTMP server handler to support them"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Go\nif err := tcpHandle(conn); err != nil {\n    if strings.HasPrefix(err.Error(), \"rtmp: unknown command\") {\n        log.Warn().Msg(\"client sent unsupported RTMP intent; dropping connection\")\n        conn.Close()\n    }\n}","preventionTips":["Use standard RTMP clients/libraries that issue only play/publish","Log and reject malformed clients early after handshake","Keep RTMP client libraries updated"],"tags":["rtmp","unsupported-command","protocol"],"backgroundTag":"unsupported-operation","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"}