{"record":{"id":"58d419b6340b5d8e","repo":"AlexxIT/go2rtc","slug":"hap-wrong-deviceid","errorCode":null,"errorMessage":"hap: wrong DeviceID: ","messagePattern":"hap: wrong DeviceID: ","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/hap/client_pairing.go","lineNumber":270,"sourceCode":"\tif err = tlv8.Unmarshal(b, &plainM6); err != nil {\n\t\treturn\n\t}\n\n\t// STEP M6. Verify payload\n\tremoteSign, err := hkdf.Sha512(\n\t\tsessionShared, \"Pair-Setup-Accessory-Sign-Salt\", \"Pair-Setup-Accessory-Sign-Info\",\n\t)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tb = Append(remoteSign, plainM6.Identifier, plainM6.PublicKey)\n\tif !ed25519.ValidateSignature([]byte(plainM6.PublicKey), b, []byte(plainM6.Signature)) {\n\t\treturn errors.New(\"hap: ValidateSignature\")\n\t}\n\n\tif c.DeviceID != plainM6.Identifier {\n\t\treturn errors.New(\"hap: wrong DeviceID: \" + plainM6.Identifier)\n\t}\n\n\tc.DevicePublic = []byte(plainM6.PublicKey)\n\n\treturn nil\n}\n\nfunc (c *Client) ListPairings() error {\n\tplainM1 := struct {\n\t\tMethod byte `tlv8:\"0\"`\n\t\tState  byte `tlv8:\"6\"`\n\t}{\n\t\tMethod: MethodListPairings,\n\t\tState:  StateM1,\n\t}\n\tres, err := c.Post(PathPairings, MimeTLV8, tlv8.MarshalReader(plainM1))\n\tif err != nil {\n\t\treturn err","sourceCodeStart":252,"sourceCodeEnd":288,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/pkg/hap/client_pairing.go#L252-L288","documentation":"HAP client pairing M6 verification guard: the accessory's signature validated, but the Identifier in the Pair-Setup response does not match the DeviceID the client configured (plainM6.Identifier appended). The client is talking to (or configured for) a different accessory than expected — a pairing-target mismatch.","triggerScenarios":"Thrown at pkg/hap/client_pairing.go:270 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the DeviceID in the source URL/config against the code printed on the accessory","Reset pairing on both sides and re-pair to the correct device","Verify no proxy/redirect is routing to a different accessory"],"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"}