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

sftp.fastGet sometimes throws an exception that can't be caught #129

Open
metalgrid opened this issue Apr 4, 2019 · 0 comments
Open

sftp.fastGet sometimes throws an exception that can't be caught #129

metalgrid opened this issue Apr 4, 2019 · 0 comments

Comments

@metalgrid
Copy link

metalgrid commented Apr 4, 2019

Hi,
I've an app that opens multiple simultaneous ssh2 connections and uses sftp.fastGet to retrieve a set of files in a try/catch block. However, sometimes the program bails with:

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
    at maybeCallback (fs.js:128:9)
    at Object.write (fs.js:535:14)
    at onread (/home/iskren/Projects/grapher/node_modules/ssh2-streams/lib/sftp.js:1120:17)
    at cb (/home/iskren/Projects/grapher/node_modules/ssh2-streams/lib/sftp.js:899:7)
    at SFTPStream._transform (/home/iskren/Projects/grapher/node_modules/ssh2-streams/lib/sftp.js:417:17)
    at SFTPStream.Transform._read (_stream_transform.js:190:10)
    at SFTPStream._read (/home/iskren/Projects/grapher/node_modules/ssh2-streams/lib/sftp.js:183:15)
    at SFTPStream.Transform._write (_stream_transform.js:178:12)
    at doWrite (_stream_writable.js:410:12)
    at writeOrBuffer (_stream_writable.js:394:5)

At other times it works as intended and at third times it just leaves an open ssh connection without any data goin through it but that's probably for another issue.

Using ssh2-streams 0.4.2 with node v10.15.3

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