{"record":{"id":"b6125d7aa2f7985f","repo":"apache/seatunnel","slug":"invalid-host-specified-b6125d","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-sftp/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sftp/system/SFTPFileSystem.java","lineNumber":96,"sourceCode":"    public static final String E_DIR_CREATE_FROMFILE =\n            \"Can't make directory for path %s since it is a file.\";\n    public static final String E_MAKE_DIR_FORPATH =\n            \"Can't make directory for path \\\"%s\\\" under \\\"%s\\\".\";\n    public static final String E_DIR_NOTEMPTY = \"Directory: %s is not empty.\";\n    public static final String E_FILE_CHECK_FAILED = \"File check failed\";\n    public static final String E_NOT_SUPPORTED = \"Not supported\";\n    public static final String E_SPATH_NOTEXIST = \"Source path %s does not exist\";\n    public static final String E_DPATH_EXIST = \"Destination path %s already exist, cannot rename!\";\n    public static final String E_FAILED_GETHOME = \"Failed to get home directory\";\n    public static final String E_FAILED_DISCONNECT = \"Failed to disconnect\";\n\n    private void setConfigurationFromURI(URI uriInfo, Configuration conf) throws IOException {\n\n        // get host information from URI\n        String host = uriInfo.getHost();\n        host = (host == null) ? conf.get(FS_SFTP_HOST, null) : host;\n        if (host == null) {\n            throw new IOException(E_HOST_NULL);\n        }\n        conf.set(FS_SFTP_HOST, host);\n\n        int port = uriInfo.getPort();\n        port = (port == -1) ? conf.getInt(FS_SFTP_HOST_PORT, DEFAULT_SFTP_PORT) : port;\n        conf.setInt(FS_SFTP_HOST_PORT, port);\n\n        // get user/password information from URI\n        String userAndPwdFromUri = uriInfo.getUserInfo();\n        if (userAndPwdFromUri != null) {\n            String[] userPasswdInfo = userAndPwdFromUri.split(\":\");\n            String user = userPasswdInfo[0];\n            user = URLDecoder.decode(user, \"UTF-8\");\n            conf.set(FS_SFTP_USER_PREFIX + host, user);\n            if (userPasswdInfo.length > 1) {\n                conf.set(FS_SFTP_PASSWORD_PREFIX + host + \".\" + user, userPasswdInfo[1]);\n            }\n        }","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-file/connector-file-sftp/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sftp/system/SFTPFileSystem.java#L78-L114","documentation":"SFTPFileSystem.setConfigurationFromURI requires an SFTP host, taken from the URI authority or the fs.sftp.host config. If both are absent it throws IOException with constant E_HOST_NULL = \"Invalid host specified\". Without a host the filesystem cannot open any SSH connection, so initialization fails fast.","triggerScenarios":"initialize(uri, conf) called with a URI lacking a host (e.g. sftp:///path or sftp://) and Configuration has no fs.sftp.host property set.","commonSituations":"Constructing a Path/URI programmatically without the authority; config file missing fs.sftp.host while using relative URIs; environment-dependent URI resolution dropping the host.","solutions":["Include the host in the URI: sftp://myhost/path/to/file","Or set conf.set(\"fs.sftp.host\", \"myhost\") before initializing the filesystem","Validate the URI authority string in your job config before submission"],"exampleFix":"// before\nURI uri = URI.create(\"sftp:///data/input.csv\"); // no host\n// after\nURI uri = URI.create(\"sftp://sftp.example.com/data/input.csv\");","handlingStrategy":"validation","validationCode":"URI u = jobUri;\nif (u.getHost() == null && conf.get(\"fs.sftp.host\") == null)\n    throw new IllegalArgumentException(\"SFTP host missing: set URI authority or fs.sftp.host\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always build SFTP URIs with an explicit authority (sftp://host/path)","Set fs.sftp.host as a fallback default in job config","Validate URIs in config parsing before job submission"],"tags":["sftp","config","missing-host"],"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-14T11:17:12.474Z"}