steelbrain / steelbrain/node-ssh
"error:failure" on putFile command
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1k
- Forks
- 94
- PR merge metrics
- No merged PRs in 30d
Description
I have an error on putFile command where the error message is just "Failure" (one word).
Since I entered this, I've managed to correct the error itself (see comment below), but it's worth changing the error message to something more explicit, like "the name of the target file is not specified". An alternative would be to presume the target file has the same name as the source file. Back to the body of the issue...
The connection and getFile commands appear to be working. This is on Ubuntu 16.04.3 LTS.
Here's the connection code with the putfile. The complete error stack follows.
const NodeSSH = require('node-ssh');
node_ssh = new NodeSSH()
node_ssh.connect({
host: 'my.remote.host',
username: 'uuuuuu',
password: 'pppppp',
hostKeys: ['ssh-xxxxxxxx='],
privateKey: '/path/to/keys/mykey.ppk'
}).then (function() {
node_ssh.putFile('/path/to/public/directory/myfile.zip', '/path/on/remote/server/' )
.then(function() {
console.log("The File thing is done")
}, function(error) {
console.log("Something's wrong in node_ssh.putFiles60: " + error.message)
console.log( error)
})
}) }
****Error stack:****
Something's wrong in node_ssh.putFiles60: Failure
{ Error: Failure
at SFTPStream._transform (/path/to/project/node_modules/node-ssh/node_modules/ssh2-streams/lib/sftp.js:412:27)
at SFTPStream.Transform._read (_stream_transform.js:190:10)
at SFTPStream._read (/var/www/confluence_to_zoomin_server/node-react-starter/node_modules/node-ssh/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 SFTPStream.Writable.write (_stream_writable.js:294:11)
at Channel.ondata (_stream_readable.js:663:20)
at Channel.emit (events.js:182:13)
at addChunk (_stream_readable.js:283:12)
at readableAddChunk (_stream_readable.js:264:11)
at Channel.Readable.push (_stream_readable.js:219:10)
at SSH2Stream.<anonymous> (/var/www/confluence_to_zoomin_server/node-react-starter/node_modules/node-ssh/node_modules/ssh2/lib/Channel.js:167:15)
at SSH2Stream.emit (events.js:182:13)
at parsePacket (/var/www/confluence_to_zoomin_server/node-react-starter/node_modules/node-ssh/node_modules/ssh2-streams/lib/ssh.js:3191:10)
at SSH2Stream._transform (/var/www/confluence_to_zoomin_server/node-react-starter/node_modules/node-ssh/node_modules/ssh2-streams/lib/ssh.js:701:13) code: 4, lang: '' }
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the putFile entry point and reproduce the call using a remote directory as the destination. The stack points to node_modules/node-ssh/node_modules/ssh2-streams/lib/sftp.js:412, where the generic Failure is surfaced. Done means putFile reports a more explicit missing-target error or clearly documents the required destination path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100