{"record":{"id":"a1d0d4234b8d8f82","repo":"apache/hadoop","slug":"server-sent-non-wrapped-response","errorCode":null,"errorMessage":"Server sent non-wrapped response","messagePattern":"Server sent non-wrapped response","errorType":"exception","errorClass":"SaslException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslRpcClient.java","lineNumber":626,"sourceCode":"      headerBuilder.mergeDelimitedFrom(bis);\n\n      boolean isWrapped = false;\n      // Must be SASL wrapped, verify and decode.\n      if (headerBuilder.getCallId() == AuthProtocol.SASL.callId) {\n        RpcSaslProto.Builder saslMessage = RpcSaslProto.newBuilder();\n        saslMessage.mergeDelimitedFrom(bis);\n        if (saslMessage.getState() == SaslState.WRAP) {\n          isWrapped = true;\n          byte[] token = saslMessage.getToken().toByteArray();\n          if (LOG.isDebugEnabled()) {\n            LOG.debug(\"unwrapping token of length:\" + token.length);\n          }\n          token = saslClient.unwrap(token, 0, token.length);\n          unwrappedRpcBuffer = ByteBuffer.wrap(token);\n        }\n      }\n      if (!isWrapped) {\n        throw new SaslException(\"Server sent non-wrapped response\");\n      }\n    }\n  }\n\n  class WrappedOutputStream extends FilterOutputStream {\n    public WrappedOutputStream(OutputStream out) throws IOException {\n      super(out);\n    }\n    @Override\n    public void write(byte[] buf, int off, int len) throws IOException {\n      if (LOG.isDebugEnabled()) {\n        LOG.debug(\"wrapping token of length:\" + len);\n      }\n      buf = saslClient.wrap(buf, off, len);\n      RpcSaslProto saslMessage = RpcSaslProto.newBuilder()\n          .setState(SaslState.WRAP)\n          .setToken(ByteString.copyFrom(buf, 0, buf.length))\n          .build();","sourceCodeStart":608,"sourceCodeEnd":644,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslRpcClient.java#L608-L644","documentation":"Error \"Server sent non-wrapped response\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslRpcClient.java:626 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify both ends agree on the SASL quality of protection (auth vs auth-int/auth-conf); the server response was not wrapped as expected.","Check rpc.protection settings on client and server are compatible.","Align Hadoop versions; capture traffic if corruption is suspected."],"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-22T20:17:22.307Z"}