-
-
Notifications
You must be signed in to change notification settings - Fork 932
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
SFTP: "client not connected" after server closed connection #1474
Comments
This issue happened only if I didn't set the |
As mention by Rob-Hague in #843 (comment) , this can't really be fixed. Even if the check that throws the exception would be removed, the sending itself would fail. The only way to avoid this, is to configure a keep alive on the client or the server. |
Reopening this. We have a case where the keep alive doesn't help. Affected server is PSFTPd . I think there is at least one issue in SSH.NET: if the "Client not connected" exception happens, I would expect Idea why the keep alive doesn't help: maybe the SFTP subsession needs its own keep-alive? Or maybe the server is just not reacting to keep alives and closing the session either way.... fyi @Rob-Hague
|
There also seems be a related issue where the client can get into a broken state. Even after re-connect with We currently work around both issues by explicitly disconnecting before doing a reconnect. This seems to work (for now).
Also worth mentioning that when the server disconnects the session, we do get an |
if the server closes the session and the client reconnects, this currently leads to a broken state because the session is re-created, but the SFTP subsession is not and still references the old session. This causes all operations to fail with "client not connected" or even throwing the "An established connection was aborted by the server." exception of the old session. Always re-create the SFTP subsession to fix this. fixes sshnet#1474
if the server closes the session and the client reconnects, this currently leads to a broken state because the session is re-created, but the SFTP subsession is not and still references the old session. This causes all operations to fail with "client not connected" or even throwing the "An established connection was aborted by the server." exception of the old session. Always re-create the SFTP subsession to fix this. fixes sshnet#1474
As reported by multiple people here #843 (comment) , #1362 does not completely fix the general issue. A "client not connected" exception can still happen after checking for
IsConnected
.I will try to reproduce this and create a PR.
The text was updated successfully, but these errors were encountered: