{"record":{"id":"c8fca9c1c364b65b","repo":"AlexxIT/go2rtc","slug":"dvrip-unknown-packet-type-x","errorCode":null,"errorMessage":"dvrip: unknown packet type: %X","messagePattern":"dvrip: unknown packet type: %X","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/dvrip/client.go","lineNumber":201,"sourceCode":"\t\t}\n\t\tc.buf = append(c.buf, b...)\n\t}\n\n\tif !bytes.HasPrefix(c.buf, []byte{0, 0, 1}) {\n\t\treturn 0, nil, fmt.Errorf(\"dvrip: wrong packet: %0.16x\", c.buf)\n\t}\n\n\tvar size int\n\n\tswitch pType = c.buf[3]; pType {\n\tcase 0xFC, 0xFE:\n\t\tsize = int(binary.LittleEndian.Uint32(c.buf[12:])) + 16\n\tcase 0xFD: // PFrame\n\t\tsize = int(binary.LittleEndian.Uint32(c.buf[4:])) + 8\n\tcase 0xFA, 0xF9:\n\t\tsize = int(binary.LittleEndian.Uint16(c.buf[6:])) + 8\n\tdefault:\n\t\treturn 0, nil, fmt.Errorf(\"dvrip: unknown packet type: %X\", pType)\n\t}\n\n\tfor len(c.buf) < size {\n\t\tif b, err = c.ReadChunk(); err != nil {\n\t\t\treturn 0, nil, err\n\t\t}\n\t\tc.buf = append(c.buf, b...)\n\t}\n\n\tpayload = c.buf[:size]\n\tc.buf = c.buf[size:]\n\n\treturn\n}\n\ntype Response map[string]any\n\nfunc (c *Client) ReadJSON() (res Response, err error) {","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/pkg/dvrip/client.go#L183-L219","documentation":"The DVRIP packet header's type byte (buf[3]) is not one of the recognized types (0xFC, 0xFE, 0xFD PFrame, 0xFA, 0xF9), so payload size cannot be computed. Indicates a protocol mismatch or corrupt stream; raised by ReadPacket, called from Start and probe.","triggerScenarios":"Thrown at pkg/dvrip/client.go:201 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Update the parser to support the new packet type emitted by this camera firmware","Reconnect to resynchronize in case of stream corruption"],"exampleFix":null,"handlingStrategy":"retry","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"}