{"record":{"id":"ac1a9618d85f3314","repo":"AlexxIT/go2rtc","slug":"invalid-hl-magic-x-x","errorCode":null,"errorMessage":"invalid HL magic: %x %x","messagePattern":"invalid HL magic: %x %x","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/wyze/client.go","lineNumber":474,"sourceCode":"\tbinary.LittleEndian.PutUint16(b[4:], KCmdSetResolution) // 10056\n\tbinary.LittleEndian.PutUint16(b[6:], 5)                 // payload len\n\tb[16] = frameSize + 1                                   // frame size\n\tbinary.LittleEndian.PutUint16(b[17:], bitrate)          // bitrate\n\t// b[19:21] = FPS (0 = auto)\n\treturn b\n}\n\nfunc (c *Client) parseK10001(data []byte) (challenge []byte, status byte, err error) {\n\tif c.verbose {\n\t\tfmt.Printf(\"[Wyze] parseK10001: received %d bytes\\n\", len(data))\n\t}\n\n\tif len(data) < 33 {\n\t\treturn nil, 0, fmt.Errorf(\"data too short: %d bytes\", len(data))\n\t}\n\n\tif data[0] != 'H' || data[1] != 'L' {\n\t\treturn nil, 0, fmt.Errorf(\"invalid HL magic: %x %x\", data[0], data[1])\n\t}\n\n\tcmdID := binary.LittleEndian.Uint16(data[4:])\n\tif cmdID != KCmdChallenge {\n\t\treturn nil, 0, fmt.Errorf(\"expected cmdID 10001, got %d\", cmdID)\n\t}\n\n\tstatus = data[16]\n\tchallenge = make([]byte, 16)\n\tcopy(challenge, data[17:33])\n\n\treturn challenge, status, nil\n}\n\nfunc (c *Client) parseK10003(data []byte) (*AuthResponse, error) {\n\tif c.verbose {\n\t\tfmt.Printf(\"[Wyze] parseK10003: received %d bytes\\n\", len(data))\n\t}","sourceCodeStart":456,"sourceCodeEnd":492,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/pkg/wyze/client.go#L456-L492","documentation":"parseK10001 received a challenge response whose magic bytes are not 'H','L' (the expected 0x48 0x4C header), so the payload is not a valid K10001 auth packet. Both offending bytes are hex-printed; raised during doKAuth.","triggerScenarios":"Thrown at pkg/wyze/client.go:474 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Restart the P2P session to resynchronize the K stream","Verify the device firmware speaks the K protocol version expected"],"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"}