{"record":{"id":"3daacb0b5418d5f2","repo":"apache/seatunnel","slug":"login-failed-on-server-s-port-d-as-user-s","errorCode":null,"errorMessage":"Login failed on server - %s, port - %d as user '%s', reply code: %d","messagePattern":"Login failed on server - (.+?), port - (.+?) as user '(.+?)', reply code: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-file/connector-file-ftp/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/ftp/system/SeaTunnelFTPFileSystem.java","lineNumber":175,"sourceCode":"        int port = conf.getInt(FS_FTP_HOST_PORT, FTP.DEFAULT_PORT);\n        String user = conf.get(FS_FTP_USER_PREFIX + host);\n        String password = conf.get(FS_FTP_PASSWORD_PREFIX + host);\n\n        // Connect to the FTP server\n        client.connect(host, port);\n        int reply = client.getReplyCode();\n        if (!FTPReply.isPositiveCompletion(reply)) {\n            throw NetUtils.wrapException(\n                    host,\n                    port,\n                    NetUtils.UNKNOWN_HOST,\n                    0,\n                    new ConnectException(\"Server response \" + reply));\n        }\n\n        // Log in to the FTP server\n        if (!client.login(user, password)) {\n            throw new IOException(\n                    String.format(\n                            \"Login failed on server - %s, port - %d as user '%s', reply code: %d\",\n                            host, port, user, client.getReplyCode()));\n        }\n\n        // Set the file type to binary and buffer size\n        client.setFileType(FTP.BINARY_FILE_TYPE);\n        client.setBufferSize(DEFAULT_BUFFER_SIZE);\n        client.setFileTransferMode(FTP.BLOCK_TRANSFER_MODE);\n\n        // Set the connection mode\n        setFsFtpConnectionMode(client, connectionMode);\n\n        // Log successful connection information\n        LOG.info(\n                String.format(\n                        \"Successfully connected to FTP server %s:%d in %s\",\n                        host, port, connectionMode));","sourceCodeStart":157,"sourceCodeEnd":193,"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#L157-L193","documentation":"During connect(), after establishing the control connection to the FTP server, SeaTunnelFTPFileSystem calls client.login(user, password). If the server rejects the credentials it throws IOException with the host, port, user and the FTP reply code. The reply code (e.g. 530) distinguishes bad credentials from other login rejections.","triggerScenarios":"Calling connect() (directly or via client(), openFileStatusListingSession(), getHomeDirectory()) when the FTP server returns a negative reply to the LOGIN command for the configured user/password.","commonSituations":"Wrong password or username in URI userinfo / fs.ftp.user.<host> config; account locked or expired; FTP server restricts logins by IP; user lacks permission to log in (vs. later permission errors); anonymous login disallowed on the server.","solutions":["Verify the username/password in the URI (ftp://user:pass@host) or fs.ftp.user.<host>/fs.ftp.password.<host> configs","Check the FTP server logs or reply code in the message: 530 typically means authentication rejected by the server","Confirm the account is enabled and allowed to log in from the client's IP (allow/deny rules, FTP server policy)","Test the same credentials with a standard FTP client (lftp/curl) to isolate SeaTunnel from the server"],"exampleFix":"// before\npath = \"ftp://admin:wrongpass@ftp.example.com/data\"\n// after\npath = \"ftp://admin:correctpass@ftp.example.com/data\" // verified with lftp","handlingStrategy":"try-catch","validationCode":"// Preflight login test before running the job\nFTPClient c = new FTPClient();\nc.connect(host, port);\nboolean ok = c.login(user, password);\nc.logout(); c.disconnect();\nif (!ok) throw new IllegalStateException(\"FTP login rejected for user \" + user + \", reply=\" + c.getReplyCode());","typeGuard":null,"tryCatchPattern":"try {\n    return ftpFileSystem.connect();\n} catch (IOException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"Login failed\")) {\n        throw new AuthenticationException(\"Check FTP credentials/server policy: \" + e.getMessage(), e);\n    }\n    throw e;\n}","preventionTips":["Test credentials with curl/lftp before submitting the job","Verify the FTP account is enabled and not IP-restricted","Use a dedicated service account for SeaTunnel with a stable password","Treat reply code 530 as an authentication-rejection signal"],"tags":["ftp","authentication","login","network"],"backgroundTag":"authentication-failed","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"}