{"record":{"id":"a10ddb2928d54c12","repo":"apache/hadoop","slug":"client-is-out-of-sync-with-server","errorCode":null,"errorMessage":"Client is out of sync with server","messagePattern":"Client is out of sync with server","errorType":"exception","errorClass":"SaslException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslRpcClient.java","lineNumber":497,"sourceCode":"   *  \n   * @param saslResponse - client response to challenge\n   * @param serverIsDone - server negotiation state\n   * @throws SaslException - any problems with negotiation\n   */\n  private byte[] saslEvaluateToken(RpcSaslProto saslResponse,\n      boolean serverIsDone) throws SaslException {\n    byte[] saslToken = null;\n    if (saslResponse.hasToken()) {\n      saslToken = saslResponse.getToken().toByteArray();\n      saslToken = saslClient.evaluateChallenge(saslToken);\n    } else if (!serverIsDone) {\n      // the server may only omit a token when it's done\n      throw new SaslException(\"Server challenge contains no token\");\n    }\n    if (serverIsDone) {\n      // server tried to report success before our client completed\n      if (!saslClient.isComplete()) {\n        throw new SaslException(\"Client is out of sync with server\");\n      }\n      // a client cannot generate a response to a success message\n      if (saslToken != null) {\n        throw new SaslException(\"Client generated spurious response\");        \n      }\n    }\n    return saslToken;\n  }\n\n  private RpcSaslProto.Builder createSaslReply(SaslState state,\n                                               byte[] responseToken) {\n    RpcSaslProto.Builder response = RpcSaslProto.newBuilder();\n    response.setState(state);\n    if (responseToken != null) {\n      response.setToken(ByteString.copyFrom(responseToken));\n    }\n    return response;\n  }","sourceCodeStart":479,"sourceCodeEnd":515,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslRpcClient.java#L479-L515","documentation":"Error \"Client is out of sync with server\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslRpcClient.java:497 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the connection; the SASL state machines on client and server are out of sync.","Ensure connections are not reused across authentication attempts improperly.","Align Hadoop versions and check for middleboxes altering the RPC stream."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}