{"record":{"id":"ff368178311afc01","repo":"AlexxIT/go2rtc","slug":"rtmp-read-command-x","errorCode":null,"errorMessage":"rtmp: read command %x","messagePattern":"rtmp: read command %x","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/rtmp/server.go","lineNumber":133,"sourceCode":"const (\n\tCommandConnect       = \"connect\"\n\tCommandReleaseStream = \"releaseStream\"\n\tCommandFCPublish     = \"FCPublish\"\n\tCommandCreateStream  = \"createStream\"\n\tCommandPublish       = \"publish\"\n\tCommandPlay          = \"play\"\n)\n\nfunc (c *Conn) acceptCommand(b []byte) error {\n\titems, err := amf.NewReader(b).ReadItems()\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\t//log.Printf(\"%#v\", items)\n\n\tif len(items) < 2 {\n\t\treturn fmt.Errorf(\"rtmp: read command %x\", b)\n\t}\n\n\tcmd, ok := items[0].(string)\n\tif !ok {\n\t\treturn fmt.Errorf(\"rtmp: read command %x\", b)\n\t}\n\n\ttID, ok := items[1].(float64) // transaction ID\n\tif !ok {\n\t\treturn fmt.Errorf(\"rtmp: read command %x\", b)\n\t}\n\n\tswitch cmd {\n\tcase CommandConnect:\n\t\tif len(items) == 3 {\n\t\t\tif v, ok := items[2].(map[string]any); ok {\n\t\t\t\tc.App, _ = v[\"app\"].(string)\n\t\t\t}","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/pkg/rtmp/server.go#L115-L151","documentation":"Framing guards in RTMP acceptCommand: the decoded AMF0 items are fewer than two, or the first item is not a string command name, so the RTMP command message is malformed. The raw bytes are the faulting input.","triggerScenarios":"Thrown at pkg/rtmp/server.go:133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the publisher speaks standard AMF0-encoded RTMP commands","Inspect the raw bytes to identify the encoder producing malformed commands"],"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"}