{"record":{"id":"7e601e1a25725694","repo":"apache/seatunnel","slug":"unsupported-ftp-connection-mode-mode-using-de","errorCode":null,"errorMessage":"Unsupported FTP connection mode: ${mode}, Using default FTP connection mode: ${FtpConnectionMode.ACTIVE_LOCAL.getMode()}","messagePattern":"Unsupported FTP connection mode: (.+?), Using default FTP connection mode: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-file/connector-file-ftp/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/ftp/system/SeaTunnelFTPFileSystem.java","lineNumber":239,"sourceCode":"                    }\n\n                    LOG.info(\"Using active mode for FTP connection\");\n                } catch (IOException e) {\n                    // if active mode failed, switch to passive mode\n                    client.enterLocalPassiveMode();\n                    // update the connection mode to passive mode\n                    getConf()\n                            .set(FS_FTP_CONNECTION_MODE, FtpConnectionMode.PASSIVE_LOCAL.getMode());\n                } finally {\n                    // delete the test directory if it was created\n                    FTPFile[] files = client.listFiles(pathName);\n                    if (files != null && files.length > 0) {\n                        client.deleteFile(pathName);\n                    }\n                }\n                break;\n            default:\n                log.warn(\n                        \"Unsupported FTP connection mode: \" + mode,\n                        \" Using default FTP connection mode: \"\n                                + FtpConnectionMode.ACTIVE_LOCAL.getMode());\n                client.enterLocalActiveMode();\n                break;\n        }\n    }\n\n    /**\n     * Logout and disconnect the given FTPClient. *\n     *\n     * @param client FTPClient\n     */\n    void disconnect(FTPClient client) {\n        if (client == null || !client.isConnected()) {\n            return;\n        }\n","sourceCodeStart":221,"sourceCodeEnd":257,"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/SeaTunnelFTPFileSystem.java#L221-L257","documentation":"setFsFtpConnectionMode parses the configured connection-mode string via FtpConnectionMode.fromMode and switches on the result. Any mode that falls into the default branch (an unrecognized value) logs this warning and silently falls back to local active mode instead of failing the job. It is a configuration-typo diagnostic, not an exception.","triggerScenarios":"The fs.ftp.connection-mode option is set to a string that FtpConnectionMode.fromMode cannot resolve to PASSIVE_LOCAL or ACTIVE_LOCAL (typo, wrong casing if fromMode is case-sensitive, or an empty/placeholder value), causing the switch to hit its default branch during connect().","commonSituations":"Typo like 'pasv' or 'passive' instead of the exact enum string; copying a mode name from another FTP library; config key populated by templating with an unset variable; case mismatch between config and the enum's accepted values.","solutions":["Inspect the config value of fs.ftp.connection-mode and set it to exactly one of the FtpConnectionMode values: the mode strings returned by FtpConnectionMode.getMode() (e.g. passive_local / active_local).","If unsure, remove the option to let the connector use its default behavior.","Check FtpConnectionMode.fromMode to confirm whether the value is case-sensitive and normalize the config accordingly."],"exampleFix":"// before\nfs.ftp.connection-mode = PASSIVE\n// after\nfs.ftp.connection-mode = passive_local","handlingStrategy":"validation","validationCode":"// Validate the configured mode against FtpConnectionMode before submit:\nString mode = config.getString(\"fs.ftp.connection-mode\");\nboolean valid = java.util.Arrays.stream(FtpConnectionMode.values())\n        .anyMatch(m -> m.getMode().equalsIgnoreCase(mode));\nif (!valid) {\n    throw new IllegalArgumentException(\"fs.ftp.connection-mode must be one of \"\n        + java.util.Arrays.toString(FtpConnectionMode.values()) + \" but was \" + mode);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy the mode string exactly from the FtpConnectionMode enum's getMode() values","Keep config values lowercase/consistent with what fromMode() expects","Validate FTP options in a pre-submit config check rather than discovering the fallback in logs"],"tags":["ftp","config","enum","fallback"],"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-23T08:17:48.524Z"}