SFTP: An established connection was aborted by the software in your host machine

0 votes
asked Jun 30, 2014 by kilsek (120 points)
edited Jul 8, 2014

Hello,

I'm having intermittent disconnection issues with the Rebex SFTP component. For many months, we have transfers large files via the component. Recently, we began having trouble with disconnects on a specific file at a specific time of the day. To my knowledge, no changes have been implemented on our side for several months.

The host server claims that they have not changed anything. Below is the Debug info for a failed session. It seems to connect, authenticate, then dies after two minutes. Normally, the next message would be "SSH: Requesting subsystem 'sftp'". This step never occurs, instead throwing an exception.

We have the local firewall disabled, antivirus software has not changed since March (issue began 5/13/13). I'm pushing back on the host to help troubleshoot, but they are just throwing their hands up and leaving it on us to figure out.

Please take a look at the log/exception and let me know if there is anything that I can do to further troubleshoot this issue.

Thanks!

---------- BEGIN LOG ---------------

2014-06-23 05:39:44.246 INFO Sftp(1)[1] Info: Connecting to someserver.com:22 using Sftp 3.0.4981.0.
2014-06-23 05:39:48.731 DEBUG Sftp(1)[1] SSH: Server is 'SSH-2.0-mod_sftp/0.9.8'.
2014-06-23 05:39:48.731 INFO Sftp(1)[1] SSH: Negotiation started.
2014-06-23 05:39:50.074 DEBUG Sftp(1)[1] SSH: Group exchange.
2014-06-23 05:39:51.184 DEBUG Sftp(1)[1] SSH: Negotiating key.
2014-06-23 05:39:52.512 DEBUG Sftp(1)[1] SSH: Validating signature.
2014-06-23 05:39:54.059 INFO Sftp(1)[1] SSH: Negotiation finished.
2014-06-23 05:39:54.059 INFO Sftp(1)[1] Info: Server: SSH-2.0-mod_sftp/0.9.8
2014-06-23 05:39:54.199 INFO Sftp(1)[1] Info: Fingerprint: 53:3a:80:8b:49:4c:9c:75:d9:6c:a7:4e:95:70:6d:64
2014-06-23 05:39:54.262 INFO Sftp(1)[1] Info: Cipher info: SSH 2.0, DiffieHellmanGroupExchangeSHA256, DSS, aes256-ctr/aes256-ctr, /
2014-06-23 05:39:55.668 INFO Sftp(1)[1] SSH: Received banner: Property of a company. Unauthorized use prohibited. 
2014-06-23 05:39:55.887 DEBUG Sftp(1)[1] SSH: Allowed authentication methods: publickey, password.
2014-06-23 05:39:58.137 DEBUG Sftp(1)[1] SSH: Trying public key authentication for 'email@address.com'.
2014-06-23 05:40:02.200 DEBUG Sftp(1)[1] SSH: Authentication successful.
2014-06-23 05:42:21.467 ERROR Sftp(1)[1] SSH: Rebex.Net.SshException: The connection was aborted. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
at Rebex.Net.ProxySocket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at Rebex.Net.SshSession.NX(OU A, Boolean B)
--- End of inner exception stack trace ---
at Rebex.Net.SshSession.NX(OU A, Boolean B)
at Rebex.Net.SshSession.IY(SshChannelType A, Int32 B, Object[] C)
2014-06-23 05:42:21.545 ERROR Sftp(1)[1] Info: Rebex.Net.SshException: The connection was aborted. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
at Rebex.Net.ProxySocket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at Rebex.Net.SshSession.NX(OU A, Boolean B)
--- End of inner exception stack trace ---
at Rebex.Net.SshSession.NX(OU A, Boolean B)
at Rebex.Net.SshSession.IY(SshChannelType A, Int32 B, Object[] C)
at Rebex.Net.SshSession.OpenChannel(SshChannelType type, Int32 bufferSize)
at Rebex.Net.Sftp.XZ(CEB A)
at Rebex.Net.Sftp.HO(String A, String B, SshPrivateKey C, CEB D)
Applies to: Rebex SFTP

2 Answers

0 votes
answered Jul 1, 2014 by Tomas Knopp (58,560 points)
edited Jul 2, 2014

Hello,

thank you for the log file. According to it, Rebex SFTP client is able to connect and authenticate to the SFTP server, but then when it tries to open an SSH channel, the connection seems to be closed by the server.

Please try a third party SFTP client, e.g. PSFTP and then let us know whether PSFTP works with the specific file or not.

commented Jul 1, 2014 by kilsek (120 points)
edited Jul 1, 2014

I can connect and transfer the file via Filezilla with no issues. Additionally, Rebex is able to successfully transfer the same file about 5 out of 7 days a week. The failure is not consistently on a specific day, ruling out scheduled outage/downtime.

From your response, it seems that I was reading the error correctly, in that "your host" is referring to the server, not the client machine? (An established connection was aborted by the software in your host machine)

commented Jul 2, 2014 by Tomas Knopp (58,560 points)
edited Jul 2, 2014

See my answer.

0 votes
answered Jul 2, 2014 by Tomas Knopp (58,560 points)
edited Jul 8, 2014

Sorry, I made a mistake as we cannot say for sure that this is the fault of the server. It might be some software in the computer where you run Rebex SFTP (this is what the exception message suggests), or some device along the way from server to client, or a misbehaved server as well.

However, if the exception only occurs sometimes I suggest you to use a try catch block around the Login method and in the case of catching the particular exception (Rebex.Net.SshException: The connection was aborted.) try to reconnect and relogin again. Retry a certain number of times e.g. 3 times before giving up and throwing the SshException. If this is some kind of tweak this solution might help (in fact clients like FileZilla often retry operations).

Please let us know if the above did help to resolve the issue.

...