Skip to content

Packet corrupt on connection failure #49

Open
@aphyr

Description

@aphyr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions