Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An existing connection was forcibly closed by the remote host #1526

Open
Speed7811 opened this issue Oct 26, 2024 · 1 comment
Open

An existing connection was forcibly closed by the remote host #1526

Speed7811 opened this issue Oct 26, 2024 · 1 comment

Comments

@Speed7811
Copy link

Speed7811 commented Oct 26, 2024

Dear all,

we are using SSH.NET 2024.2.0.0 with a .NET 4.7.2 console application to download files via SFTP from our german provider Strato.

We sporadically have the problem that we receive the error 10054 (An existing connection was forcibly closed by the remote host) when downloading files. Sometimes this occurs after a few minutes and sometimes after a few seconds.

We have tried the following:

  1. Run our application on different PCs => Error occurs
  2. Waited between 200ms and 1000ms before downloading each file => error occurs
  3. Run app via on a different internet connection => Error occurs
  4. Used an internal SSH server => Error does not occur! In this test, we let it run for several hours

In all our tests, we simply downloaded files via SFTP in the loop and waited.

Then we followed the debug instruction of SSH.NET and compiled SSH.NET using the debug function and activated the trace.
If we have activated the trace, the error does not occur.
If we deactivate the source “System.Net.Sockets” in the trace and only activate the source “SshNet.Logging”, the problem occurs (trace attached)

If we have only activated “System.Net.Sockets” in the trace, the problem does not occur - regardless of whether we are using a TextWriter or a ConsoleWriter.

Due to the fact that it sometimes occurs when the trace is activated and sometimes not, we rather suspect a bug in SSH.NET. Especially because we used to download the files with WinSCP / Filezilla and never had any problems.

Here is the exception:
image

The trace trace.sshnet.log in the attachment.

trace.sshnet.log

Best regards

Rainer

@Speed7811 Speed7811 changed the title An established connection was aborted by the server An existing connection was forcibly closed by the remote host Oct 26, 2024
@revealer409
Copy link

Solution: In my case I was using SSH.NET library from some xyz vendor removed package from Nugget package manager and then installed SSH.NET by Renci fixed my issue.

issue background: due to some issue infra team has deleted FTP/*/Log directory from Server after that i was getting this issue
'An existing connection was forcibly closed by the remote host'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants