{"record":{"id":"55c13b7ea78da48d","repo":"apache/seatunnel","slug":"unsupported-auth-type","errorCode":"UNSUPPORTED_AUTH_TYPE","errorMessage":"Unsupported authentication type: %s. Supported types: %s","messagePattern":"Unsupported authentication type: (.+?)\\. Supported types: (.+?)","errorType":"error_code","errorClass":"ElasticsearchConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/client/auth/AuthenticationProviderFactory.java","lineNumber":66,"sourceCode":"     * Create an authentication provider based on the configuration.\n     *\n     * <p>This method examines the auth_type configuration parameter and creates the appropriate\n     * authentication provider. If no auth_type is specified, it defaults to basic authentication\n     * for backward compatibility.\n     *\n     * @param config the readonly configuration containing authentication settings\n     * @return the appropriate authentication provider\n     * @throws ElasticsearchConnectorException if the auth_type is not supported\n     */\n    public static AuthenticationProvider createProvider(ReadonlyConfig config) {\n        AuthTypeEnum authType =\n                config.getOptional(ElasticsearchBaseOptions.AUTH_TYPE).orElse(DEFAULT_AUTH_TYPE);\n\n        log.debug(\"Creating authentication provider for type: {}\", authType);\n\n        Class<? extends AuthenticationProvider> providerClass = PROVIDER_REGISTRY.get(authType);\n        if (providerClass == null) {\n            throw new ElasticsearchConnectorException(\n                    UNSUPPORTED_AUTH_TYPE,\n                    String.format(\n                            \"Unsupported authentication type: %s. Supported types: %s\",\n                            authType, PROVIDER_REGISTRY.keySet()));\n        }\n\n        try {\n            AuthenticationProvider provider = providerClass.getDeclaredConstructor().newInstance();\n            provider.validate(config);\n            log.info(\"Successfully created authentication provider: {}\", authType);\n            return provider;\n        } catch (Exception e) {\n            throw new ElasticsearchConnectorException(\n                    UNSUPPORTED_AUTH_TYPE,\n                    String.format(\n                            \"Failed to create authentication provider for type: %s\", authType),\n                    e);\n        }","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/client/auth/AuthenticationProviderFactory.java#L48-L84","documentation":"AuthenticationProviderFactory.createProvider throws this when the configured auth_type does not map to any registered authentication provider. The registry only contains basic, api_key, and api_key_encoded; anything else (or an unregistered enum) triggers UNSUPPORTED_AUTH_TYPE with the list of supported types.","triggerScenarios":"Setting auth_type in the Elasticsearch connector config to a value that parses to an AuthTypeEnum but has no registered provider class in PROVIDER_REGISTRY (e.g., a newly added enum constant without a provider, or a null/unknown mapping).","commonSituations":"Using a SeaTunnel version where the desired auth mechanism is not yet supported; typo variants that still resolve to an enum but lack a provider; copying config examples from newer releases into older clusters.","solutions":["Use one of the supported types printed in the message: basic, api_key, or api_key_encoded","Fix the auth_type value in the job config to exactly one of the supported strings","Upgrade SeaTunnel if you need an auth mechanism newer than your current version"],"exampleFix":"// before\n\"auth_type\": \"oauth\"\n// after\n\"auth_type\": \"api_key\"","handlingStrategy":"validation","validationCode":"// Validate auth_type before submitting the job:\nSet<String> supported = Set.of(\"basic\", \"api_key\", \"api_key_encoded\");\nString authType = config.getOptional(\"auth_type\").orElse(\"basic\");\nif (!supported.contains(authType)) throw new IllegalArgumentException(\"Unsupported auth_type: \" + authType);","typeGuard":null,"tryCatchPattern":"try {\n    AuthenticationProvider p = AuthenticationProviderFactory.createProvider(config);\n} catch (ElasticsearchConnectorException e) {\n    // message lists supported types; surface it to the user\n    throw new IllegalArgumentException(\"Fix auth_type in config: \" + e.getMessage(), e);\n}","preventionTips":["Only use auth_type values from the connector docs for your SeaTunnel version","Keep values lowercase with no whitespace","Check the release notes before copying auth config from newer examples"],"tags":["elasticsearch","authentication","configuration","enum"],"backgroundTag":"unsupported-enum-value","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}