{"record":{"id":"107fe6ad7a1b76a0","repo":"apache/hadoop","slug":"unknown-authentication-type-s","errorCode":null,"errorMessage":"Unknown authentication type: %s","messagePattern":"Unknown authentication type: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-cloud-storage-project/hadoop-gcp/src/main/java/org/apache/hadoop/fs/gs/HadoopCredentialsConfiguration.java","lineNumber":175,"sourceCode":"\n      return UserCredentials.newBuilder()\n              .setClientId(clientId)\n              .setClientSecret(clientSecret.getValue())\n              .setRefreshToken(refreshToken.getValue())\n              .build();\n\n    case WORKLOAD_IDENTITY_FEDERATION_CREDENTIAL_CONFIG_FILE:\n      String configFile =\n              WORKLOAD_IDENTITY_FEDERATION_CREDENTIAL_CONFIG_FILE_SUFFIX\n                      .withPrefixes(keyPrefixes)\n                      .get(config, config::get);\n      try (FileInputStream fis = new FileInputStream(configFile)) {\n        return ExternalAccountCredentials.fromStream(fis);\n      }\n    case UNAUTHENTICATED:\n      return null;\n    default:\n      throw new IllegalArgumentException(\"Unknown authentication type: \" + authenticationType);\n    }\n  }\n\n  private static GoogleCredentials configureCredentials(\n          Configuration config, List<String> keyPrefixes, GoogleCredentials credentials) {\n    credentials = credentials.createScoped(CLOUD_PLATFORM_SCOPE);\n    String tokenServerUrl =\n            TOKEN_SERVER_URL_SUFFIX.withPrefixes(keyPrefixes).get(config, config::get);\n    if (tokenServerUrl == null) {\n      return credentials;\n    }\n    if (credentials instanceof ServiceAccountCredentials) {\n      return ((ServiceAccountCredentials) credentials)\n              .toBuilder().setTokenServerUri(URI.create(tokenServerUrl)).build();\n    }\n    if (credentials instanceof UserCredentials) {\n      return ((UserCredentials) credentials)\n              .toBuilder().setTokenServerUri(URI.create(tokenServerUrl)).build();","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-cloud-storage-project/hadoop-gcp/src/main/java/org/apache/hadoop/fs/gs/HadoopCredentialsConfiguration.java#L157-L193","documentation":"The default branch of the auth switch in HadoopCredentialsConfiguration.getCredentials: the configured AuthenticationType does not correspond to any handled constant. Handled values are APPLICATION_DEFAULT, COMPUTE_ENGINE, SERVICE_ACCOUNT_JSON_KEYFILE, WORKLOAD_IDENTITY_FEDERATION_CREDENTIAL_CONFIG_FILE, UNAUTHENTICATED, USER_CREDENTIALS. Hadoop's Configuration.getEnum normally rejects unknown strings earlier with its own error, so this fires mainly for null/unresolvable values that slip into the switch.","triggerScenarios":"The auth type property resolves to a value outside the AuthenticationType enum (e.g. 'SERVICE_ACCOUNT' from another connector, or a null after config manipulation), and getEnum passes it through to the switch's default branch.","commonSituations":"Version upgrades where old auth type constant names were removed/renamed; configs copied from other GCS tools (gcloud, bigquery connector) with different type names; programmatic Configuration edits clearing or corrupting fs.gs.auth.type.","solutions":["Use one of the six exact enum values for fs.gs.auth.type / google.cloud.auth.type.","If you do not need explicit auth config, remove the property to fall back to the built-in default (COMPUTE_ENGINE).","Double-check spelling/case - the value must match the enum constant exactly."],"exampleFix":"<!-- before -->\n<property><name>fs.gs.auth.type</name><value>SERVICE_ACCOUNT</value></property> <!-- not an enum value -->\n\n<!-- after -->\n<property><name>fs.gs.auth.type</name><value>SERVICE_ACCOUNT_JSON_KEYFILE</value></property>","handlingStrategy":"validation","validationCode":"Set<String> valid = Set.of(\"APPLICATION_DEFAULT\", \"COMPUTE_ENGINE\", \"SERVICE_ACCOUNT_JSON_KEYFILE\",\n    \"WORKLOAD_IDENTITY_FEDERATION_CREDENTIAL_CONFIG_FILE\", \"UNAUTHENTICATED\", \"USER_CREDENTIALS\");\nString t = conf.get(\"fs.gs.auth.type\");\nif (t != null && !valid.contains(t)) {\n  throw new IllegalArgumentException(\"Invalid fs.gs.auth.type: \" + t + \"; valid: \" + valid);\n}","typeGuard":null,"tryCatchPattern":"catch IllegalArgumentException with message startsWith(\"Unknown authentication type\") (or Configuration.getEnum's own 'Not a enum value' error) - correct the property to one of the six enum constants or unset it to use the default.","preventionTips":["Copy auth type values from the connector's AuthenticationType enum, not from other tools' docs.","After upgrading the connector, re-verify configured enum names still exist."],"tags":["authentication","gcs","hadoop","configuration","enum"],"backgroundTag":"unknown-auth-type","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}