Skip to content

Error: SFTP session ended early #32

Description

@nickolasclarke

JS (and programming) noob here:

when using the .get method I can successfully get the payload I want back, at which point things crash and burn. From what I can gather, this may be a bug in the dependency of ssh2-streams (mscdex/ssh2-streams#28) but I may just be doing it wrong. See my code and the subsequent error below, your patience and help is much appreciated!:

var sequest = require('sequest');

var test;
   var reader = sequest.get('user@server.com', '/home/user/config.json', {
       readyTimeout: 20000
     }, function (error, stdout) {
       if (error) {
         throw error;
       }
     }
   );
   reader.pipe(test = process.stdout);
   console.log(test);
        throw er; // Unhandled 'error' event
              ^
Error: SFTP session ended early
    at SFTPStream._cleanup (/home/nclarke/node_modules/sequest/node_modules/ssh2/node_modules/ssh2-streams/lib/sftp.js:195:15)
    at SFTPStream.onFinish (/home/nclarke/node_modules/sequest/node_modules/ssh2/node_modules/ssh2-streams/lib/sftp.js:159:10)
    at SFTPStream.EventEmitter.emit (events.js:117:20)
    at finishMaybe (_stream_writable.js:356:12)
    at endWritable (_stream_writable.js:363:3)
    at SFTPStream.Writable.end (_stream_writable.js:341:5)
    at Channel.onend (_stream_readable.js:483:10)
    at Channel.g (events.js:180:16)
    at Channel.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:920:16````

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions