{"record":{"id":"4c9b871f03494159","repo":"apache/seatunnel","slug":"unsupported-auth-type-4c9b87","errorCode":null,"errorMessage":"Unsupported auth type: ","messagePattern":"Unsupported auth type: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/config/AuthTypeEnum.java","lineNumber":53,"sourceCode":"\n    public String getValue() {\n        return value;\n    }\n\n    /**\n     * Get AuthTypeEnum from string value.\n     *\n     * @param value the string value\n     * @return the corresponding AuthTypeEnum\n     * @throws IllegalArgumentException if the value is not supported\n     */\n    public static AuthTypeEnum fromValue(String value) {\n        for (AuthTypeEnum authType : values()) {\n            if (authType.getValue().equals(value)) {\n                return authType;\n            }\n        }\n        throw new IllegalArgumentException(\"Unsupported auth type: \" + value);\n    }\n}\n","sourceCodeStart":35,"sourceCodeEnd":56,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/config/AuthTypeEnum.java#L35-L56","documentation":"AuthTypeEnum.fromValue throws an IllegalArgumentException when the given string does not match any known auth type value (basic, api_key, api_key_encoded). It is a strict config-parsing guard so invalid auth_type strings fail early with a clear message instead of silently misbehaving.","triggerScenarios":"Calling AuthTypeEnum.fromValue (or any config parsing path that uses it) with an auth_type string that is not exactly one of 'basic', 'api_key', or 'api_key_encoded'.","commonSituations":"Typos like 'apikey', 'API_KEY', 'basic-auth'; case sensitivity (values are lowercase); copying auth types from other connectors (e.g., 'bearer', 'jwt'); trailing whitespace in YAML/HOCON values.","solutions":["Set auth_type to exactly one of: basic, api_key, api_key_encoded (lowercase, no spaces)","Remove leading/trailing whitespace or quotes issues in the config file","If you need another mechanism (e.g., bearer token), it is unsupported — use api_key or upgrade SeaTunnel"],"exampleFix":"// before\n\"auth_type\": \"API_KEY\"\n// after\n\"auth_type\": \"api_key\"","handlingStrategy":"validation","validationCode":"// Normalize and validate before conversion:\nString v = rawAuthType == null ? \"basic\" : rawAuthType.trim().toLowerCase(Locale.ROOT);\nif (!List.of(\"basic\",\"api_key\",\"api_key_encoded\").contains(v)) {\n    throw new IllegalArgumentException(\"auth_type must be one of basic|api_key|api_key_encoded, got: \" + rawAuthType);\n}","typeGuard":"boolean isValidAuthType(String v) {\n    return v != null && (v.equals(\"basic\") || v.equals(\"api_key\") || v.equals(\"api_key_encoded\"));\n}","tryCatchPattern":"try {\n    AuthTypeEnum t = AuthTypeEnum.fromValue(rawAuthType.trim());\n} catch (IllegalArgumentException e) {\n    throw new IllegalArgumentException(\"Unsupported auth_type '\" + rawAuthType + \"'; use basic, api_key, or api_key_encoded\", e);\n}","preventionTips":["Use lowercase values exactly: basic, api_key, api_key_encoded","Trim whitespace from config values loaded from YAML/HOCON","Wrap fromValue with normalization (trim/lowercase) at config-load time"],"tags":["elasticsearch","authentication","enum","configuration"],"backgroundTag":"invalid-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"}