ssh2 icon indicating copy to clipboard operation
ssh2 copied to clipboard

Fatal error: length > kMaxLength when connecting to multiple boxes in parallel

Open ArnoldZokas opened this issue 12 years ago • 1 comments

I am trying to send commands over SSH to multiple boxes in parallel using async module. When I execute against a single box - my code works. When I execute against two boxes - it fails.

Source: https://github.com/ArnoldZokas/grunt-ssh-multi-exec/blob/multi/src/grunt-ssh-multi-exec.js

Here's the debug log:

DEBUG: Parser: STATE_INIT
DEBUG: Parser: STATE_GREETING
DEBUG: Parser: STATE_HEADER
DEBUG: Connection: Server ident: 'SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.1'
DEBUG: Parser: STATE_PACKETBEFORE (expecting 8)
DEBUG: Parser: STATE_PACKET
DEBUG: Parser: pktLen:980,padLen:9,remainLen:976
DEBUG: Parser: STATE_PACKETDATA
DEBUG: Parser: STATE_PACKETDATAAFTER, packet: KEXINIT
DEBUG: Parser: STATE_PACKETBEFORE (expecting 8)
DEBUG: Parser: STATE_PACKET
DEBUG: Parser: pktLen:36,padLen:8,remainLen:32
DEBUG: Parser: STATE_PACKETDATA
DEBUG: Parser: STATE_PACKETDATAAFTER, packet: DISCONNECT
Connection error: Error: Disconnected by host (PROTOCOL_ERROR): Packet corrupt
Connection error: Error: Disconnected by host (PROTOCOL_ERROR): Packet corrupt
DEBUG: Parser: STATE_PACKETBEFORE (expecting 8)
DEBUG: Parser: STATE_PACKET
DEBUG: Parser: pktLen:1397966893,padLen:50,remainLen:1397966889
Fatal error: length > kMaxLength

ArnoldZokas avatar Mar 10 '14 12:03 ArnoldZokas

Never mind. Fixed it. I was reusing a connection.

ArnoldZokas avatar Mar 10 '14 12:03 ArnoldZokas