SFTP connection java.net.SocketTimeoutException: Read timed out
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2018 02:03 AM
I'm trying to establish SFTP connection in SNOW in order to send some files, I'm testing my script in "Scripts - Background" tab, that's how the code looks like:
try {
var pt = new Packages.java.util.Properties();
pt.setProperty("connection.host", "host");
pt.setProperty("connection.port", 22);
pt.setProperty("user.login", "user");
pt.setProperty("user.password", "pass");
pt.setProperty("connection.type", "AUTH_SSL_FTP_CONNECTION");
pt.setProperty("connection.timeout", "6000");
pt.setProperty("connection.passive", "false");
var connection = Packages.org.ftp4che.FTPConnectionFactory.getInstance(pt);
gs.log("Starting connection");
connection.connect();
gs.log("Connected!!!!!");
} catch (e) {
gs.log("[FTP] e: " + e);
gs.log("[FTP] Line number: " + e.lineNumber);
gs.log("[FTP] Source: " + e.sourceName);
gs.log("[FTP] Name: " + e.name);
gs.log("[FTP] Message: " + e.message);
}
But whatever configuration I try I'm always getting the same error:
*** Script: [FTP] e: java.net.SocketTimeoutException: Read timed out
*** Script: [FTP] Line number: undefined
*** Script: [FTP] Source: undefined
*** Script: [FTP] Name: undefined
I though that it's caused because of some kind of firewall or other security measure but I can clearly establish SFTP connection from the instance server without a problem so why can't I connect from SNOW?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2018 10:13 AM
I guess its the issue with the Timeout, you need to increase the timeout value
https://help.avalara.com/Frequently_Asked_Questions/001/How_do_I_resolve_a_java.net.SocketTimeoutException%3A_Read_timed_out%3F
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2018 02:10 AM
No, that's not the cause. Even when I set the timeout to 60 minutes the same error happens.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2018 02:20 AM
Can you check the number of connection to that SFTP, there might be some limit for the connection
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2018 02:34 AM
I tried two different SFTPs and the same error.