How to correctly handle the EOF when closing ssh connection

2,507 views
Skip to first unread message

qing tang

unread,
Sep 23, 2015, 11:22:02 PM9/23/15
to sshj-users
Hi Guys,

I got one issue when close the ssh connection. Could you please help to check?

When I tried to close it, but sshj lib reported "Broken transport; encountered EOF".

How to correctly handle this exception?  Any other steps needed to clean the resource to avoid memory leak?

Logs:

2015-09-23-T14:18:11.053+0300 | pool-17-thread-1 | INFO  | net.schmizz.sshj.connection.channel.direct.SessionChannel | Sending close
2015-09-23-T14:18:11.264+0300 |  | reader          | ERROR | net.schmizz.sshj.transport.TransportImpl | Dying because - net.schmizz.sshj.transport.TransportException: Broken transport; encountered EOF
2015-09-23-T14:18:11.266+0300 |  | reader          | INFO  | net.schmizz.sshj.connection.ConnectionImpl | Forgetting `session` channel (#0)
2015-09-23-T14:18:11.266+0300 | pool-17-thread-1 | ERROR | net.schmizz.concurrent.Event | <<chan#0 / close>> woke to: net.schmizz.sshj.connection.ConnectionException: Broken transport; encountered EOF
2015-09-23-T14:18:11.267+0300 | pool-17-thread-1 | WARN  | Failed to close the SSH connection due to Broken transport; encountered EOF
net.schmizz.sshj.connection.ConnectionException: Broken transport; encountered EOF
        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.Future.error(Future.java:95)
        at net.schmizz.concurrent.FutureUtils.alertAll(FutureUtils.java:24)
        at net.schmizz.sshj.connection.channel.AbstractChannel.notifyError(AbstractChannel.java:239)
        at net.schmizz.sshj.common.ErrorNotifiable$Util.alertAll(ErrorNotifiable.java:34)
        at net.schmizz.sshj.connection.ConnectionImpl.notifyError(ConnectionImpl.java:152)
        at net.schmizz.sshj.transport.TransportImpl.die(TransportImpl.java:545)
        at net.schmizz.sshj.transport.Reader.run(Reader.java:79)
Caused by: net.schmizz.sshj.transport.TransportException: Broken transport; encountered EOF
        at net.schmizz.sshj.transport.Reader.run(Reader.java:70)

Thank you.

Best Regards.
Qing

Jeroen van Erp

unread,
Sep 24, 2015, 4:30:23 AM9/24/15
to sshj-...@googlegroups.com
Hi Qing,

What's the code you use?

Regards,
Jeroen

--
You received this message because you are subscribed to the Google Groups "sshj-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sshj-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ranvijay Kumar

unread,
Jul 6, 2020, 3:39:28 AM7/6/20
to sshj-users
Getting same error while connecting with Cisco Switch, Please help 

Error:  <<chan#1 / open>> woke to: net.schmizz.sshj.connection.ConnectionException: Broken transport; encountered EOF
Reply all
Reply to author
Forward
0 new messages