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

Packet corrupt on connection failure #49

Open
aphyr opened this issue Aug 9, 2016 · 0 comments
Open

Packet corrupt on connection failure #49

aphyr opened this issue Aug 9, 2016 · 0 comments

Comments

@aphyr
Copy link
Contributor

aphyr commented Aug 9, 2016

Very occasionally, for reasons I don't understand (maybe TCP close?), a session disconnects between two calls to ssh/invoke. Works for one command, and a few ms later, another command throws:

[2016/08/04 13:37:05.617] Caused by: com.jcraft.jsch.JSchException: Packet corrupt
[2016/08/04 13:37:05.617]   at com.jcraft.jsch.Session.start_discard(Session.java:1059)
[2016/08/04 13:37:05.617]   at com.jcraft.jsch.Session.read(Session.java:929)
[2016/08/04 13:37:05.617]   at com.jcraft.jsch.Session.connect(Session.java:309)
[2016/08/04 13:37:05.617]   at com.jcraft.jsch.Session.connect(Session.java:183)
[2016/08/04 13:37:05.617]   at clj_ssh.ssh$fn__3689.invoke(ssh.clj:118)
[2016/08/04 13:37:05.617]   at clj_ssh.ssh.protocols$fn__3647$G__3614__3656.invoke(protocols.clj:4)
[2016/08/04 13:37:05.617]   at clj_ssh.ssh$connect.invoke(ssh.clj:401)
[2016/08/04 13:37:05.617]   at clj_ssh.ssh$ssh.invoke(ssh.clj:721)

This occurs when invoke checks whether the session is connected? prior to executing the command. If not, clj-ssh attempts to connect the session again. However, reconnecting closed sessions is illegal, which causes the jsch state machine to explode with "packet corrupt". I thiiink I can work around this by dropping the session and creating a new one in my clj-ssh wrapper, but it's not obvious to me how we can do the same in clj-ssh directly.

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

1 participant