ssh2: fastPut callback is not being executed

Environment

NodeJS: v14.5.0 ssh2: 0.8.9

Code Example

const ssh2 = require("ssh2");

const src = "/home/mark-rodgers/0102449171338.wav";
const dest = "20Oct27/0102449171338.wav";
const conn = new ssh2.Client();

conn.on("error", err => {
  console.log(err);
});

conn.on("ready", () => {
  console.log("connected!");
  conn.sftp((err, sftp) => {
    if (err) return;
    console.log(1);
    sftp.fastPut(src, dest, { }, err => {
      console.log(2); // file does upload, but this callback function never executes
    });
    console.log(3);
  });
});

conn.connect({ 
  host: "...",
  port: "...",
  username: "...",
  password: "..."
});

Output

connected!
1
3

Expected Result

The file does upload but the callback never gets executed, so there is no way for me to know when the upload is complete, if it was successful, or if there was an error.

connected!
1
2
3

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 19 (8 by maintainers)

Most upvoted comments

Same problem here on Node 14.15.1

I met the same problem on node v14.15.1