{"record":{"id":"9a4bdce703f24f26","repo":"apache/seatunnel","slug":"invalid-host-specified","errorCode":null,"errorMessage":"Invalid host specified","messagePattern":"Invalid host 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":101,"sourceCode":"     * Return the protocol scheme for the FileSystem.\n     *\n     * <p>\n     *\n     * @return <code>ftp</code>\n     */\n    @Override\n    public String getScheme() {\n        return \"ftp\";\n    }\n\n    @Override\n    public void initialize(URI uri, Configuration conf) throws IOException { // get\n        super.initialize(uri, conf);\n        // get host information from uri (overrides info in conf)\n        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        }","sourceCodeStart":83,"sourceCodeEnd":119,"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#L83-L119","documentation":"SeaTunnelFTPFileSystem.initialize() resolves the FTP host from the filesystem URI, falling back to the fs.ftp.host Hadoop config. If neither the URI contains a host nor the config provides one, it throws IOException('Invalid host specified') because an FTP filesystem cannot be created without a target server.","triggerScenarios":"Constructing/getting the FTP filesystem with a URI lacking a host (e.g. 'ftp:///') while conf.get(FS_FTP_HOST) is also null — e.g. path 'ftp://' or a URI built from a bare path without the ftp:// scheme/host part.","commonSituations":"SeaTunnel config 'fs.default-fs' or file path missing the host component; host supplied only under a wrong config key; template path left unrendered (e.g. '${host}' not substituted).","solutions":["Include the host in the filesystem URI, e.g. ftp://myftpserver/path","Or set the Hadoop config fs.ftp.host to the server name before obtaining the filesystem","Verify the full path string in the SeaTunnel source/sink config is a well-formed ftp:// URI with a host"],"exampleFix":"// before\npath = \"ftp:///data/files\"\n// after\npath = \"ftp://ftp.example.com/data/files\"","handlingStrategy":"validation","validationCode":"// Java\nURI uri = URI.create(path);\nif (!\"ftp\".equals(uri.getScheme()) || uri.getHost() == null) {\n    throw new IllegalArgumentException(\"FTP path must include host, e.g. ftp://host/path, got: \" + path);\n}","typeGuard":null,"tryCatchPattern":"try {\n    fileSystem.initialize(uri, conf);\n} catch (IOException e) {\n    if (\"Invalid host specified\".equals(e.getMessage())) {\n        throw new IllegalArgumentException(\"Set host in URI or fs.ftp.host config\", e);\n    }\n    throw e;\n}","preventionTips":["Always use fully qualified ftp://host/path URIs in configs","Render config templates before submission (no leftover ${host} placeholders)","Sanity-parse the URI with URI.create and check getHost() != null in a preflight step"],"tags":["ftp","config","filesystem","uri"],"backgroundTag":"missing-required-config-field","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"}