vscode-sftp
vscode-sftp copied to clipboard
Error: failure
Hi,
It's work excellente but after update i've problem:
[error] Error: Failure
at SFTPStream._transform (.vscode\extensions\liximomo.sftp-1.6.3\node_modules\ssh2-streams\lib\sftp.js:412:27)
at SFTPStream.Transform._read (_stream_transform.js:186:10)
at SFTPStream._read (.vscode\extensions\liximomo.sftp-1.6.3\node_modules\ssh2-streams\lib\sftp.js:183:15)
at SFTPStream.Transform._write (_stream_transform.js:174:12)
at doWrite (_stream_writable.js:387:12)
at writeOrBuffer (_stream_writable.js:373:5)
at SFTPStream.Writable.write (_stream_writable.js:290:11)
at Channel.ondata (_stream_readable.js:639:20)
at emitOne (events.js:116:13)
at Channel.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Channel.Readable.push (_stream_readable.js:208:10)
at SSH2Stream.
{ "protocol": "sftp", "host": "127.0.0.1", "port": 2222, "username": "...", "password": "...", "remotePath": "...", "watcher": { "files": "/*", "autoUpload": false, "autoDelete": false }, "uploadOnSave": true, "syncMode": "full", "ignore": [ "/.vscode", "/.git", "/.DS_Store" ] }
It's work excellente. Which version? Does it work now? Downgrading Visual Studio Code extension.
but after update i've problem. Does this error always happen?
FYI. The failure error message comes from the remote side and is more or less the default/generic error message that SSH' sftp server sends when a syscall fails or similar. To know what exactly is going wrong you could try to enable debug output for the sftp server and then execute your transfers again and see what (if anything) shows up in the logs there.
It doesn't work. Still the sam error.
Does this error always happen?
Always, after update.
Which version? Does it work now? Downgrading Visual Studio Code extension.
Example link: https://liximomo.gallery.vsassets.io/_apis/public/gallery/publisher/liximomo/extension/sftp/1.5.13/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage Is it ok?
Ok, I've disabled extension autoupdate options and it's work on 1.5.13 version. There is a problem o 1.6 version.
Can you provide the full logs of v1.6.3.
-
Open User Settings.
- On Windows/Linux - File > Preferences > Settings
- On macOS - Code > Preferences > Settings
-
Set
sftp.printDebugLog
totrue
and reload vscode. -
Reproduce the problem, get the logs from View > Output > sftp.
https://pastebin.com/fjtZHq2m Full logs :)
Sorry, can't see any errors.
Sorry, can't see any errors.
At line 4116. [error] Error: Failure
I have the same issues ! it's was workign fine before ! any news ?
Got the same issue as well. https://pastebin.com/RGU5SmsA
@szymoneko @bscript @philipaarseth https://github.com/liximomo/vscode-sftp/blob/master/FAQ.md#error-failure
But I've go Windows 10
I got it to work. It's part of my hosting file structure, I needed to put the full path, not just "remote-path": "/", but "remotePath": "/customers/c/4/d/domain.com/httpd.www/",
@liximomo maybe you could add it as a suggestion in the FAQ 👍
I just installed version I can't get it to work with full remote path too. Always get error failure. It just downloads the folder and not any files.
Ok now it seems to work. After I added syncmode:full, rewrote the remotepath and saved the sftp.json file. I then click Sync remote->local to download all the remote files to local environment. However, it still gave random error:failure couple of times after the password timed out and I pressed Sync remote->local again to continue the download. And then it started downloading again. It gets stuck with long sync as needs password all the time. Is it possible to cache or store the password in the simple config (not profiles).
Possible solution:
I had the same issue. As it seemed, my problem was my remotePath /home/edwin/projects/website
contained a symlink, that was not handled well, resulting in [error] Error: Failure
.
Changing the remote path to the actual path the symlink was linking to, /usr/share/nginx/website
solved this.
Yeah we are having the same problem with symlinks here. Strangely using the symlink works for me but not for my colleague. Both same setup:
_Vscode Version _SFTP Extension Version _sftp.json file
symbolic Link directory ?
@sdir Yeah, like so:
"/project-a/public"
where public is the symlink directory
Possible solution:
I had the same issue. As it seemed, my problem was my remotePath
/home/edwin/projects/website
contained a symlink, that was not handled well, resulting in[error] Error: Failure
.Changing the remote path to the actual path the symlink was linking to,
/usr/share/nginx/website
solved this.
I have same issues and change symlink to hard link solve this problem. But I use symlink directory before, It works. And suddenly, it failed. Wired.
In my case
use symlink path: some file upload fail use absolute path: everything is all right (until now)
I face the same issue. List directory works fine but file upload wont work.
Error: Failure sftp.js:412 at SFTPStream._transform (c:\SURESH\vsoncode\NodeCode\algorithmserviceGL\node_modules\ssh2-streams\lib\sftp.js:412:27) at SFTPStream.Transform._read (_stream_transform.js:186:10) at SFTPStream._read (c:\SURESH\vsoncode\NodeCode\algorithmserviceGL\node_modules\ssh2-streams\lib\sftp.js:183:15) at SFTPStream.Transform._write (_stream_transform.js:174:12) at doWrite (_stream_writable.js:387:12) at writeOrBuffer (_stream_writable.js:373:5) at SFTPStream.Writable.write (_stream_writable.js:290:11) at Channel.ondata (_stream_readable.js:639:20) at emitOne (events.js:116:13) at Channel.emit (events.js:211:7)
My code
var conn = new Client(); conn.on('ready', function() { conn.sftp(function(err, sftp) { if (err) throw err;
var fs = require("fs"); // Use node filesystem
var readStream = fs.createReadStream( "C:/Users/path/file.txt" );
var writeStream = sftp.createWriteStream( remotePathToList );
writeStream.on('close',function () {
console.log( "- file transferred succesfully" );
});
writeStream.on('end', function () {
console.log( "sftp connection closed" );
conn.close();
});
// initiate transfer of file
readStream.pipe( writeStream );
});
}).connect(connSettings);
I have the same "Error: Failure" issue.
- OS: Mac
- VSCode Version 1.39.2
- Extension Version 1.12.9
Suggestions above didn't help. Remote path is absolute.
config
{
"name": "project",
"host": "192.168.10.10",
"protocol": "sftp",
"port": 22,
"username": "*****",
"password": "*****",
"remotePath": "/opt/applications/project",
"ignore": [".vscode", ".git", "node_modules", ".DS_Store"],
"uploadOnSave": false,
"watcher": {
"files": "**/*",
"autoUpload": true,
"autoDelete": true
}
}
sftp.log (look to the end of file)
Any suggestions? ~p.s. the problem appeared recently before vscode 1.39 update I guess.~
Update
~Checked on previous versions of vscode up to 1.37.0 / sftp 1.12.0 - the same issue.
Looks like the problem might be somewhere else.
But it appears and repeats only after changing git branch. Any further attempts to sync to remote ends the same way. But if I clean remote folder before run sync - all work or, sync completes successful. But again, any further branch change will break sync, and only one way to fix is completely cleanup destination folder on remote to properly sync again.
Can't tell why this happen, but I've found that branches may differ by existence of symbolic (shortcuts) link files.
~
~@szymoneko, can you please check if folders with symbolic links syncs fine when changing branches?~
Update 2 Disabling watcher solves the issue, but now I have to run sync manually each time. So it appears to be an issue with watcher right during switching branches.
Update 3 Looks like symbolic links persistent really matters, or idk what else. Because now even manual sync Failure
[10-24 13:18:21] [error] Error: Failure
at SFTPStream._transform (/Users/usr/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams/lib/sftp.js:412:27)
at SFTPStream.Transform._read (_stream_transform.js:190:10)
at SFTPStream._read (/Users/usr/.vscode/extensions/liximomo.sftp-1.12.9/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:666: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> (/Users/usr/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2/lib/Channel.js:167:15)
at SSH2Stream.emit (events.js:182:13)
at parsePacket (/Users/usr/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams/lib/ssh.js:3288:10)
at SSH2Stream._transform (/Users/usr/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams/lib/ssh.js:694:13)
at SSH2Stream.Transform._read (_stream_transform.js:190:10)
at SSH2Stream._read (/Users/usr/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams/lib/ssh.js:253:15)
at SSH2Stream.Transform._write (_stream_transform.js:178:12)
at doWrite (_stream_writable.js:410:12)
at writeOrBuffer (_stream_writable.js:394:5)
at SSH2Stream.Writable.write (_stream_writable.js:294:11)
at Socket.ondata (_stream_readable.js:666:20)
at Socket.emit (events.js:182:13)
at addChunk (_stream_readable.js:283:12)
at readableAddChunk (_stream_readable.js:264:11)
at Socket.Readable.push (_stream_readable.js:219:10)
at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17) when local ➞ remote /Users/usr/Documents/work/Git/project/php-lib/tools/vendor/simplesamlphp/simplesamlphp/locales/no
[10-24 13:18:21] [info] local ➞ remote /Users/usr/Documents/work/Git/project/project/packing_slip.php
[10-24 13:18:21] [info] local ➞ remote /Users/usr/Documents/work/Git/project/php-lib/tools/vendor/bin/export-plural-rules
[10-24 13:18:21] [info] local ➞ remote /Users/usr/Documents/work/Git/project/php-lib/tools/vendor/bin/export-plural-rules.php
Thanks Man! It worked perfectly!
Possible Culprit: No More Drive Space. I found that I was getting this nondescript error because I was out of drive space. I cleared out the runaway logs folder and freed up 40GB of uselessness and power-cycled the server. Problem solved. That is to say that the issue was not vscode-sftp, but rather my own carelessness in monitoring my server log consumption.
Proposal: Enhance error messaging in sftp.js Is there a way to capture disc space and report it to the user when there is an error like this?
200Gigs free space. So that is not a reason in my case.
Had a similar issue. Found the problem to be the "remotePath" was pointing to a symlink on Linux server. When changed to the actual path, problem solved.
@cloudqubes, that is not my case. "remotePath" is set to absolute.
I have the same issue with symlink in "remotePath". It works only with real path. Additionally SFTP browser doesn't show symlink directories on server in list.
Good day to all
I had the same problem, but I fixed it with the absolute path.
I also want to indicate that this problem does not occur in subdomains only in the main domain.
Greetings from Colombia co