{"record":{"id":"ad1dd8c2892e1588","repo":"apache/seatunnel","slug":"unknown-ftp-connection-mode-mode","errorCode":null,"errorMessage":"Unknown ftp connection mode: ${mode}","messagePattern":"Unknown ftp connection mode: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-file/connector-file-ftp/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/ftp/system/FtpConnectionMode.java","lineNumber":45,"sourceCode":"    PASSIVE_LOCAL(\"passive_local\");\n\n    private final String mode;\n\n    FtpConnectionMode(String mode) {\n        this.mode = mode;\n    }\n\n    public String getMode() {\n        return mode;\n    }\n\n    public static FtpConnectionMode fromMode(String mode) {\n        for (FtpConnectionMode ftpConnectionModeEnum : FtpConnectionMode.values()) {\n            if (ftpConnectionModeEnum.getMode().equals(mode.toLowerCase())) {\n                return ftpConnectionModeEnum;\n            }\n        }\n        throw new IllegalArgumentException(\"Unknown ftp connection mode: \" + mode);\n    }\n}\n","sourceCodeStart":27,"sourceCodeEnd":48,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-file/connector-file-ftp/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/ftp/system/FtpConnectionMode.java#L27-L48","documentation":"FtpConnectionMode.fromMode() converts the user-supplied 'ftp.connection.mode' string into the FtpConnectionMode enum by matching against known modes (e.g. ACTIVE_LOCAL, PASSIVE_LOCAL...). If no enum constant matches after lowercasing, it throws IllegalArgumentException. This is a strict configuration-value validation guard.","triggerScenarios":"Calling fromMode with any string not equal (case-insensitively) to one of the supported mode names — typically from a typo in the 'ftp.connection.mode' config option.","commonSituations":"Misspelled mode in the SeaTunnel job config (e.g. 'passive' instead of the exact enum name); uppercase-only assumption if the value isn't normalized before this call; copied config from an older/newer connector version with renamed modes.","solutions":["Print the configured value and compare against the FtpConnectionMode enum constants (the valid mode strings)","Fix the ftp.connection.mode value in the job config to an exactly supported name (matching is case-insensitive)","Check the connector version's FtpConnectionMode source for the exact list of accepted modes"],"exampleFix":"// before\n\"ftp.connection.mode\" = \"passive-mode\"\n// after\n\"ftp.connection.mode\" = \"passive\" // must match FtpConnectionMode.getMode() exactly (case-insensitive)","handlingStrategy":"validation","validationCode":"Set<String> valid = Arrays.stream(FtpConnectionMode.values())\n    .map(FtpConnectionMode::getMode).collect(Collectors.toSet());\nif (!valid.contains(mode.toLowerCase())) throw new IllegalArgumentException(\n    \"ftp.connection.mode must be one of \" + valid + \", got: \" + mode);","typeGuard":null,"tryCatchPattern":"try {\n    FtpConnectionMode m = FtpConnectionMode.fromMode(mode);\n} catch (IllegalArgumentException e) {\n    throw new IllegalArgumentException(\"Bad ftp.connection.mode: \" + mode + \", valid: \"\n        + Arrays.toString(FtpConnectionMode.values()));\n}","preventionTips":["Copy mode values from the FtpConnectionMode enum source rather than memory","Validate the config option at job-config parse time, before connecting","Note matching is case-insensitive but spelling must match exactly"],"tags":["config","enum","ftp","validation"],"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-14T05:17:10.506Z"}