sshj icon indicating copy to clipboard operation
sshj copied to clipboard

SSHJ disconnect exception

Open dpengftw opened this issue 2 years ago • 6 comments

[reader] INFO net.schmizz.sshj.transport.TransportImpl - Received SSH_MSG_DISCONNECT (reason=BY_APPLICATION, msg=User Disconnected) [reader] ERROR net.schmizz.sshj.transport.TransportImpl - Dying because - User Disconnected net.schmizz.sshj.transport.TransportException: [BY_APPLICATION] User Disconnected at net.schmizz.sshj.transport.TransportImpl.gotDisconnect(TransportImpl.java:565) at net.schmizz.sshj.transport.TransportImpl.handle(TransportImpl.java:521) at net.schmizz.sshj.transport.Decoder.decode(Decoder.java:113) at net.schmizz.sshj.transport.Decoder.received(Decoder.java:203) at net.schmizz.sshj.transport.Reader.run(Reader.java:60) [reader] INFO net.schmizz.sshj.transport.TransportImpl - Disconnected - BY_APPLICATION [main] ERROR net.schmizz.concurrent.Promise - <<chan#0 / close>> woke to: net.schmizz.sshj.connection.ConnectionException: User Disconnected Caused by: net.schmizz.sshj.connection.ConnectionException: User Disconnected at net.schmizz.sshj.connection.ConnectionException$1.chain(ConnectionException.java:32) at net.schmizz.sshj.connection.ConnectionException$1.chain(ConnectionException.java:26) at net.schmizz.concurrent.Promise.deliverError(Promise.java:95) at net.schmizz.concurrent.Event.deliverError(Event.java:74) at net.schmizz.concurrent.ErrorDeliveryUtil.alertEvents(ErrorDeliveryUtil.java:34) at net.schmizz.sshj.connection.channel.AbstractChannel.notifyError(AbstractChannel.java:239) at net.schmizz.sshj.connection.channel.direct.SessionChannel.notifyError(SessionChannel.java:229) at net.schmizz.sshj.common.ErrorNotifiable$Util.alertAll(ErrorNotifiable.java:35) at net.schmizz.sshj.connection.ConnectionImpl.notifyError(ConnectionImpl.java:261) at net.schmizz.sshj.transport.TransportImpl.die(TransportImpl.java:620) at net.schmizz.sshj.transport.Reader.run(Reader.java:66) Caused by: net.schmizz.sshj.transport.TransportException: [BY_APPLICATION] User Disconnected at net.schmizz.sshj.transport.TransportImpl.gotDisconnect(TransportImpl.java:565) at net.schmizz.sshj.transport.TransportImpl.handle(TransportImpl.java:521) at net.schmizz.sshj.transport.Decoder.decode(Decoder.java:113) at net.schmizz.sshj.transport.Decoder.received(Decoder.java:203) at net.schmizz.sshj.transport.Reader.run(Reader.java:60)

MFT-14336/IT43709 - sshj SFTP client's sessions not getting clean disconnect after SSP upgrade When the client is closing the sftp channel, SSP was closing everything on its side . It was disconnecting the ssh connection before closing the channel. Resolution: Changed the order on SSP side to close the sftp channel and then disconnect the ssh connection. Still this jssh sample client is throwing stacktrace. Created a system property "sftp.channel.disconnect", when set to false, will bypass this disconnect (the default value is true). With this change the sshj client is terminates the connection correctly.

dpengftw avatar Jul 26 '23 17:07 dpengftw

I am also seeing the same issue after our partner changed the remote SFTP server. Any clue how it can be fixed?

akhileshagarwal85 avatar Jun 12 '24 14:06 akhileshagarwal85

We asked our partner to apply a patch to their newly migrated SFTP server and that resolved the issue, but still disconcerting that the regular unix "sftp" command would work, but not sshj. 😟

dpengftw avatar Jun 12 '24 15:06 dpengftw

What patch?

akhileshagarwal85 avatar Jun 12 '24 15:06 akhileshagarwal85

The partner's SFTP server side applied a patch, not on our end.

dpengftw avatar Jun 12 '24 15:06 dpengftw

Yes, that I understand but you said that you asked your partner to apply a patch and I thought you knew which/what patch they applied on their SFTP which fixed the issue.

akhileshagarwal85 avatar Jun 12 '24 18:06 akhileshagarwal85

I do but due to confidentiality, those details are muted here.

dpengftw avatar Jun 12 '24 19:06 dpengftw