{"record":{"id":"60177fad51046216","repo":"t8y2/dbx","slug":"zookeeper-response-xid-d-does-not-match-request-x-60177f","errorCode":null,"errorMessage":"ZooKeeper response XID %d does not match request XID %d","messagePattern":"ZooKeeper response XID (.+?) does not match request XID (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/hive-go/zookeeper_protocol.go","lineNumber":323,"sourceCode":"\trequest.int32(client.xid)\n\trequest.int32(opcode)\n\tif encodeBody != nil {\n\t\tencodeBody(request)\n\t}\n\tif err := client.writeFrame(request.data()); err != nil {\n\t\treturn nil, err\n\t}\n\tresponse, err := client.readFrame()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdecoder := newZooKeeperDecoder(response)\n\txid, err := decoder.int32()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif xid != client.xid {\n\t\treturn nil, fmt.Errorf(\"ZooKeeper response XID %d does not match request XID %d\", xid, client.xid)\n\t}\n\tif _, err := decoder.int64(); err != nil {\n\t\treturn nil, err\n\t}\n\tcode, err := decoder.int32()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := zooKeeperError(code); err != nil {\n\t\treturn nil, err\n\t}\n\treturn decoder.remaining(), nil\n}\n\nfunc (client *protocolZooKeeperClient) writeFrame(payload []byte) error {\n\tif len(payload) > zooKeeperMaxFrameSize {\n\t\treturn fmt.Errorf(\"ZooKeeper request frame is %d bytes, maximum is %d\", len(payload), zooKeeperMaxFrameSize)\n\t}","sourceCodeStart":305,"sourceCodeEnd":341,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/hive-go/zookeeper_protocol.go#L305-L341","documentation":"Returned by protocolZooKeeperClient.request when the xid in a ZooKeeper response frame does not equal the xid of the request that was sent. On a single connection responses must match requests in order; an xid mismatch indicates a protocol/stream desynchronization (concurrent use of the connection or a server bug).","triggerScenarios":"Thrown at agents/drivers/hive-go/zookeeper_protocol.go:323 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the client connection is used by a single goroutine/operation at a time as the driver intends","Retry the operation on a fresh connection if desynchronization is transient","Check the ZooKeeper server version for known wire-protocol issues"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}