Open domenic opened 9 years ago
This seems related to the fact that I am trying to scp into directories which don't yet exist, since scping to index.html works fine. My guess is that 0.1.4 would do a mkdir -p equivalent for me, whereas 2.0.0 stopped doing that. (The fact that the error message sucks is presumably a separate bug.)
It does not work for me too.
Exactly the same errors, does it come from scp2 or from a dependency ?
Same here. if I drop the version down to 0.1.4
it works.
also with 0.2.2
Maybe it is related to https://github.com/spmjs/node-scp2/pull/32
@lepture
https://github.com/spmjs/node-scp2/blob/master/lib/client.js#L225 https://github.com/spmjs/node-scp2/blob/master/lib/client.js#L234
The errors are "Permission denied".
Are you guys only seeing this on a specific platform?
For me (Ubuntu -> Ubuntu) scp2 0.2.2 creates the folders just fine, but for my coworker (Windows -> Ubuntu), the created folders lack the proper permissions (-x) and gives the Error: handle is not a Buffer
error.
The issue is that upload
calls mkdir
with incorrect attributes. attrs.mode
is set to what fs.stat()
returns for a file, which is not in the CHMOD
format (0755 and whatnot).
Also, unfortunately, in windows the permissions on folders will not have the execute bit set, which means that folders will not be executable on the remote host.
attrs.mode = attrs.mode ? '0' + (attrs.mode & 0777).toString(8) : '0755'
would solve the first issue, but I'm not sure how to deal with Windows permissions.
I am getting the following issue:
../wp-gulp-automation/node_modules/scp2/node_modules/ssh2/lib/SFTP/SFTPv3.js:227
throw new Error('handle is not a Buffer');
^
Error: handle is not a Buffer
at SFTP.write (../wp-gulp-automation/node_modules/scp2/node_modules/ssh2/lib/SFTP/SFTPv3.js:227:11)
at ../wp-gulp-automation/node_modules/scp2/lib/client.js:208:18
at FSReqWrap.wrapper [as oncomplete] (fs.js:527:17)
Process finished with exit code 1
But I noticed that the file was created on the sftp-server but without content.
I found the attrs.mode on windows is not same as it on *nix. I have the same error in windows client, I just brucly set the attrs.mode='755'
, and it work
because the dir of destination does not create before execute write
Any updates on this issue? I'm still running into it with the latest version of node-scp2.
See for example https://travis-ci.org/whatwg/streams/builds/43789094#L1383
compared to https://travis-ci.org/whatwg/streams/builds/39141547#L863 with 0.1.4
(
Also I might suck at shell scripting but I can't my Travis builds to fail when ssh2 throws an error :-/turns out I need to use Travis'sscript
hook instead ofafter_success
)