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

Connection hanging instead of closing gracefully #23

Open
jogoldberg opened this issue Jan 6, 2022 · 3 comments
Open

Connection hanging instead of closing gracefully #23

jogoldberg opened this issue Jan 6, 2022 · 3 comments

Comments

@jogoldberg
Copy link
Contributor

When our sender attempts to upload files, they're experiencing the following:

"When I try to connect to their server interactively using the "sftp" client that comes with OpenSSH and I try to "quit" the connection the interactive client hangs. I have output from one of the attempts below with verbose options set to "-vv". Note that after the "input drain -> closed" portion we seem to be hanging when we try to disconnect from this customers server. (refer to attached log1.txt file)

The SFTP we are using to transfer files is from OpenSSH_7.4p1. Information about the SFTP protocol can be found here: https://datatracker.ietf.org/doc/html/rfc4254. When this client wants to disconnect it sends a packet of type 96 which indicates that we are finished sending data. After that the client expects the server to send a packet of type 97 indicating that we can close the the channel. However, the SFTP server the customer is using is not sending the type 97 packet. I don't see any options available in the version of the client that we have in production that would allow me to end the connection without doing the packet 96/packet 97 dance. Some verbose output is shown below.

sftp> quit
debug2: channel 0: read<=0 rfd 4 len 0
debug2: channel 0: read failed
debug2: channel 0: close_read
debug2: channel 0: input open -> drain
debug2: channel 0: ibuf empty
debug2: channel 0: send eof
debug3: send packet: type 96
debug2: channel 0: input drain -> closed 

I have sent you the mentioned log1.txt via email.

@kolban-google
Copy link
Owner

We appear to have a candidate for a solution. Looking at the underlying SSH2 library that is used by this project, we find the following defect:

mscdex/ssh2#1111

This is literally "in-flight" as of the time of this report. We looked at the suggested pull request for the SSH2 1111 bug and tested it locally (a patch) and it "seems" to have worked. We will continue to investigate but, at this point, I'm assuming/thinking that the root problem is a defect in SSH2 and when that is cured, the resolution will propagate up to this package too.

@jogoldberg
Copy link
Contributor Author

We appear to have a candidate for a solution. Looking at the underlying SSH2 library that is used by this project, we find the following defect:

mscdex/ssh2#1111

This is literally "in-flight" as of the time of this report. We looked at the suggested pull request for the SSH2 1111 bug and tested it locally (a patch) and it "seems" to have worked. We will continue to investigate but, at this point, I'm assuming/thinking that the root problem is a defect in SSH2 and when that is cured, the resolution will propagate up to this package too.

I have manually patched in the change introduced by this PR and have confirmed it solves our issue. We're now just waiting for @mscdex to approve/release mscdex/ssh2#1111

@jogoldberg
Copy link
Contributor Author

I can say based on testing that it will be
Closed by mscdex/ssh2#1111

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