{"record":{"id":"2fa5c1cef3e88853","repo":"apache/seatunnel","slug":"invalid-user-password-specified","errorCode":null,"errorMessage":"Invalid user/password specified","messagePattern":"Invalid user/password specified","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":116,"sourceCode":"        String host = uri.getHost();\n        host = (host == null) ? conf.get(FS_FTP_HOST, null) : host;\n        if (host == null) {\n            throw new IOException(\"Invalid host specified\");\n        }\n        conf.set(FS_FTP_HOST, host);\n\n        // get port information from uri, (overrides info in conf)\n        int port = uri.getPort();\n        port = (port == -1) ? FTP.DEFAULT_PORT : port;\n        conf.setInt(\"fs.ftp.host.port\", port);\n\n        // get user/password information from URI (overrides info in conf)\n        String userAndPassword = uri.getUserInfo();\n        if (userAndPassword == null) {\n            String user = conf.get(\"fs.ftp.user.\" + host, null);\n            String password = conf.get(\"fs.ftp.password.\" + host, null);\n            if (user == null || password == null) {\n                throw new IOException(\"Invalid user/password specified\");\n            }\n            userAndPassword = user + \":\" + password;\n        }\n        String[] userPasswdInfo = userAndPassword.split(\":\");\n        conf.set(FS_FTP_USER_PREFIX + host, userPasswdInfo[0]);\n        if (userPasswdInfo.length > 1) {\n            conf.set(FS_FTP_PASSWORD_PREFIX + host, userPasswdInfo[1]);\n        } else {\n            conf.set(FS_FTP_PASSWORD_PREFIX + host, null);\n        }\n        setConf(conf);\n        this.uri = uri;\n    }\n\n    /**\n     * Connect to the FTP server using configuration parameters *\n     *\n     * @return An FTPClient instance","sourceCodeStart":98,"sourceCodeEnd":134,"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#L98-L134","documentation":"SeaTunnelFTPFileSystem.initialize() derives credentials from the URI userinfo; when absent it reads fs.ftp.user.<host> and fs.ftp.password.<host> from the Hadoop configuration. If no URI userinfo exists and either the user or password config is null, it throws IOException('Invalid user/password specified').","triggerScenarios":"Calling initialize() with a URI without user info (no user:pass@host) while fs.ftp.user.<host> or fs.ftp.password.<host> is not set in the Configuration; host here is the URI host or the fs.ftp.host fallback.","commonSituations":"Credentials omitted from the SeaTunnel FTP source/sink config; config keys written with the wrong host suffix (must match exactly, e.g. fs.ftp.user.ftp.example.com); URI-encoded password containing ':' mis-split later; anonymous FTP attempted without explicit user/password entries.","solutions":["Embed credentials in the URI: ftp://user:password@ftp.example.com/path","Or set both conf keys fs.ftp.user.<host> and fs.ftp.password.<host> with <host> exactly matching the URI host","Ensure the password does not break the user:password split (avoid ':' or URI-encode it)"],"exampleFix":"// before\npath = \"ftp://ftp.example.com/data\" // no credentials anywhere\n// after\npath = \"ftp://user:password@ftp.example.com/data\"\n// or: conf.set(\"fs.ftp.user.ftp.example.com\", \"user\"); conf.set(\"fs.ftp.password.ftp.example.com\", \"password\");","handlingStrategy":"validation","validationCode":"// Java\nURI uri = URI.create(path);\nboolean hasUserInfo = uri.getUserInfo() != null;\nString host = uri.getHost() != null ? uri.getHost() : conf.get(\"fs.ftp.host\");\nboolean hasConfCreds = conf.get(\"fs.ftp.user.\" + host) != null\n    && conf.get(\"fs.ftp.password.\" + host) != null;\nif (!hasUserInfo && !hasConfCreds) {\n    throw new IllegalArgumentException(\"Provide ftp user:pass in URI or fs.ftp.user/password.\" + host);\n}","typeGuard":null,"tryCatchPattern":"try {\n    fileSystem.initialize(uri, conf);\n} catch (IOException e) {\n    if (\"Invalid user/password specified\".equals(e.getMessage())) {\n        throw new IllegalArgumentException(\"Missing FTP credentials for host \" + host, e);\n    }\n    throw e;\n}","preventionTips":["Prefer credentials embedded in the URI (ftp://user:pass@host)","If using conf keys, the suffix must exactly equal the URI host","Avoid ':' in passwords or URI-encode them to keep user:pass parsing intact","Never commit credentials; inject them from a secret store"],"tags":["ftp","authentication","config","filesystem"],"backgroundTag":"missing-credentials","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"}