kolban-google / sftp-gcs

An implementation of an SFTP to Google Cloud Storage bridge.
Apache License 2.0
90 stars 36 forks source link

Breaking change: SSH2 upgraded to 1.4.0 was breaking #22

Closed kolban-google closed 2 years ago

kolban-google commented 2 years ago

A forced upgrade of dependencies by GitHub caused a breaking change. Examining now. Issue is that we now get errors that look like:

(node:19468) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'EOF' of undefined
    at SFTP.<anonymous> (/home/kolban/projects/sftp-gcs/sftp-gcs.js:663:69)
    at SFTP.emit (events.js:400:28)
    at 12 (/home/kolban/projects/sftp-gcs/node_modules/ssh2/lib/protocol/SFTP.js:3115:15)
    at SFTP.push (/home/kolban/projects/sftp-gcs/node_modules/ssh2/lib/protocol/SFTP.js:278:11)
    at CHANNEL_DATA (/home/kolban/projects/sftp-gcs/node_modules/ssh2/lib/server.js:750:23)
    at 94 (/home/kolban/projects/sftp-gcs/node_modules/ssh2/lib/protocol/handlers.misc.js:859:16)
    at Protocol.onPayload (/home/kolban/projects/sftp-gcs/node_modules/ssh2/lib/protocol/Protocol.js:2025:10)
    at AESGCMDecipherBinding.decrypt (/home/kolban/projects/sftp-gcs/node_modules/ssh2/lib/protocol/crypto.js:1086:26)
    at Protocol.parsePacket [as _parse] (/home/kolban/projects/sftp-gcs/node_modules/ssh2/lib/protocol/Protocol.js:1994:25)
    at Protocol.parse (/home/kolban/projects/sftp-gcs/node_modules/ssh2/lib/protocol/Protocol.js:293:16)
kolban-google commented 2 years ago

There was a breaking change from pre 1.0.0 of SSH2 to the latest. This was documented here:

https://github.com/mscdex/ssh2/issues/935

Thankfully, the fix was easy.