{"record":{"id":"f76628b541d1a2a5","repo":"apache/hadoop","slug":"client-cannot-authenticate-via","errorCode":null,"errorMessage":"Client cannot authenticate via:","messagePattern":"Client cannot authenticate via:","errorType":"exception","errorClass":"AccessControlException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslRpcClient.java","lineNumber":180,"sourceCode":"      }\n      AuthMethod authMethod = AuthMethod.valueOf(authType.getMethod());\n      if (authMethod == AuthMethod.SIMPLE) {\n        switchToSimple = true;\n      } else {\n        saslClient = createSaslClient(authType);\n        if (saslClient == null) { // client lacks credentials, try next\n          continue;\n        }\n      }\n      selectedAuthType = authType;\n      break;\n    }\n    if (saslClient == null && !switchToSimple) {\n      List<String> serverAuthMethods = new ArrayList<String>();\n      for (SaslAuth authType : authTypes) {\n        serverAuthMethods.add(authType.getMethod());\n      }\n      throw new AccessControlException(\n          \"Client cannot authenticate via:\" + serverAuthMethods);\n    }\n    if (LOG.isDebugEnabled() && selectedAuthType != null) {\n      LOG.debug(\"Use \" + selectedAuthType.getMethod() +\n          \" authentication for protocol \" + protocol.getSimpleName());\n    }\n    return selectedAuthType;\n  }\n\n  private boolean isValidAuthType(SaslAuth authType) {\n    AuthMethod authMethod;\n    try {\n      authMethod = AuthMethod.valueOf(authType.getMethod());\n    } catch (IllegalArgumentException iae) { // unknown auth\n      authMethod = null;\n    }\n    // do we know what it is?  is it using our mechanism?\n    return authMethod != null &&","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslRpcClient.java#L162-L198","documentation":"Error \"Client cannot authenticate via:\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslRpcClient.java:180 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Review the listed authentication methods and configure the client with one the server accepts (e.g. KERBEROS or TOKEN).","Fix hadoop.security.authentication and per-connection token configuration so a supported method is available.","Ensure the client has valid Kerberos credentials (kinit) or a valid delegation token."],"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"}