[SFTP] Error: A connection attempt failed because the connected party did not properly respo

[SFTP] Error: A connection attempt failed because the connected party did not properly respo

  
Forge Component
(3)
Published on 24 Sep (3 days ago) by Wei Zhu
3 votes
Published on 24 Sep (3 days ago) by Wei Zhu
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond (IP Address Here) 

Gives this error when using the actions of the SFTP plugin.

The connection seems to be working as I can access it with filezilla

How to resolve it?

The error suggests a communication issue, from your platform server to the target SFTP server. Often SysAdmins block traffic on port 22 (default for SFTP), so that may be the cause for the connection timeout.

Also keep in mind that the component is prepared for SFTP only (no FTP and no FTPS).
In filezilla i used port 22 and it was fine.

and yes it is defniitely sftp
so I hosted my own SFTP using FileZilla (use port 9000)

Test #1: connect the SFTP with FileZilla client, Everything works. Able to transfer files.

Test #2: connect the SFTP using the extension, same error message.

So then I look at the my SFTP FileZilla Server: Whenever I log in using FileZilla client to login, the FileZilla Server Log will say a bunch of stuff like "sending welcome message... AUTH TLS  SSL connection established" But when I tried to login with the extension, not a single text coming from the FileZilla Server. Seems it never talk to each other at all
Accord to overstack flow

http://stackoverflow.com/questions/17693353/how-to-resolve-a-connection-attempt-failed-because-the-connected-party-did-not

To resolve: 

I had a similar problem and had to convert the URL from string to Uri object using:

Uri myUri = new Uri(URLInStringFormat, UriKind.Absolute);

(URLInStringFormat is your URL) Try to connect using the Uri instead of the string as:

WebClient client = new WebClient();
client.OpenRead(myUri);
Error from service center

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond XXX.XXX.X.X:22
   at ssSFTPSample.RssExtensionSFTP.MssList(HeContext heContext, String inParamIP, Int32 inParamPort, String inParamUsername, String inParamPassword, String inParamPath, RecordList& outParamList)
   at ssSFTPSample.Flows.FlowMainFlow.ScrnHomePage.CommandList(HeContext heContext)

and 

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond XXX.XXX.X.X:22
   at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
   at Renci.SshNet.Session.SocketConnect(String host, Int32 port)
   at Renci.SshNet.Session.Connect()
   at Renci.SshNet.BaseClient.Connect()
   at OutSystems.NssSFTP.CssSFTP.MssList(String ssIP, Int32 ssPort, String ssUsername, String ssPassword, String ssPath, RLRemoteItemRecordList& ssList)
   at ssSFTPSample.RssExtensionSFTP.MssList(HeContext heContext, String inParamIP, Int32 inParamPort, String inParamUsername, String inParamPassword, String inParamPath, RecordList& outParamList)
Hi,

Did you change the extension's source code?
Try using the server's IP address instead of the hostname, I got some different behavior just due to that. Also, you may want to confirm if the server's firewall is blocking the request from your platform server (not from your computer). I assume you tried FileZilla from your pc, not from the platform server where the component is connecting from.

Here's a question...and forgive my ignorance if it doesn't make sense, not a developer.  This extension works assuming the platform server has access to the target machine.  What if you had a requirement in a closed network where the platform server could not access a local resource.  How could you create a socket within the browser to talk directly to an on-net resource.  I know it can be done with JS (Chrome Secure Shell) but can it be done using this library?  Could it be done with the library in conjunction with JS? 

Doug_inVA wrote:

Here's a question...and forgive my ignorance if it doesn't make sense, not a developer.  This extension works assuming the platform server has access to the target machine.  What if you had a requirement in a closed network where the platform server could not access a local resource.  How could you create a socket within the browser to talk directly to an on-net resource.  I know it can be done with JS (Chrome Secure Shell) but can it be done using this library?  Could it be done with the library in conjunction with JS? 

Hi Doug,

This component runs in the server only. You may be able to achieve something similar with a browser plugin, (such as Secure Shell, which I believe is not just plain JS) and in that case you won't need this component.