vscode-sftp: No Such File error on trying sftp:download
Expected Behavior
When right click on a folder/file and click SFTP Download, should download the folder/file
Actual Behavior
Getting Error “No such File” Log:
[info] config at d:\code\ems {"remotePath":"/home/frappe/frappe-bench/apps/","uploadOnSave":true,"downloadOnOpen":false,"syncMode":"update","ignore":[".vscode",".git",".DS_Store"],"watcher":{"files":false,"autoUpload":false,"autoDelete":false},"concurrency":4,"protocol":"sftp","host":"127.0.0.1","port":3021,"username":"******","password":"******","connectTimeout":10000,"interactiveAuth":false,"sshConfigPath":"~/.ssh/config","secure":false,"passive":false,"context":"d:\\code\\ems"}
[trace] execute download for d:\code\ems
[error] Error: No such file
at SFTPStream._transform (C:\Users\chirag\.vscode\extensions\liximomo.sftp-1.3.0\node_modules\ssh2-streams\lib\sftp.js:412:27)
at SFTPStream.Transform._read (_stream_transform.js:167:10)
at SFTPStream._read (C:\Users\chirag\.vscode\extensions\liximomo.sftp-1.3.0\node_modules\ssh2-streams\lib\sftp.js:183:15)
at SFTPStream.Transform._write (_stream_transform.js:155:12)
at doWrite (_stream_writable.js:329:12)
at writeOrBuffer (_stream_writable.js:315:5)
at SFTPStream.Writable.write (_stream_writable.js:241:11)
at Channel.ondata (_stream_readable.js:557:20)
at emitOne (events.js:96:13)
at Channel.emit (events.js:191:7)
at readableAddChunk (_stream_readable.js:178:18)
at Channel.Readable.push (_stream_readable.js:136:10)
at SSH2Stream.<anonymous> (C:\Users\chirag\.vscode\extensions\liximomo.sftp-1.3.0\node_modules\ssh2\lib\Channel.js:166:15)
at emitOne (events.js:96:13)
at SSH2Stream.emit (events.js:191:7)
at parsePacket (C:\Users\chirag\.vscode\extensions\liximomo.sftp-1.3.0\node_modules\ssh2-streams\lib\ssh.js:3445:10)
at SSH2Stream._transform (C:\Users\chirag\.vscode\extensions\liximomo.sftp-1.3.0\node_modules\ssh2-streams\lib\ssh.js:671:13)
at SSH2Stream.Transform._read (_stream_transform.js:167:10)
at SSH2Stream._read (C:\Users\chirag\.vscode\extensions\liximomo.sftp-1.3.0\node_modules\ssh2-streams\lib\ssh.js:253:15)
at SSH2Stream.Transform._write (_stream_transform.js:155:12)
at doWrite (_stream_writable.js:329:12)
at writeOrBuffer (_stream_writable.js:315:5)
at SSH2Stream.Writable.write (_stream_writable.js:241:11)
at Socket.ondata (_stream_readable.js:557:20)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at readableAddChunk (_stream_readable.js:178:18)
at Socket.Readable.push (_stream_readable.js:136:10)
at TCP.onread (net.js:560:20)
Steps to Reproduce the Problem
This happened after I updated VS Code today.
- Right click any file / folder in Explorer
- Click SFTP: download
Specifications
- Version:
sftp version: 1.3.0 - Platform: Windows 10 64 bit
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 45 (1 by maintainers)
I’ve got a similar issue of “No such file” when uploading files. But the file is successfully synced in fact.
vscode version: 1.56.0 sftp plugin version: 1.12.9
No such issue when using previous vscode version(1.55.*)
The exception logs are quite similar as those above:
I believe this comes from the 1.56.0 version of VS code. I downgraded to 1.55.2 and it now works. https://code.visualstudio.com/updates/v1_55
EDIT: And disable auto-updates on VS code so that it won’t go back to 1.56.0 by itself 😃
This worked for me without downgrading
https://github.com/liximomo/vscode-sftp/issues/919#issuecomment-838586635
Nice - thanks @sdir. Guess I could have figured that if I thought about it.
So to sum up all the above as TLDR for others skimming this thread:
Do a search inside
~/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams/lib/sftp.jsfor options.emitClose = false;Add
options.autoDestroy = false;after both instances.Editing the file: ~/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams/lib/sftp.js change the line 388: if (code === STATUS_CODE.OK) { to: if (code === STATUS_CODE.OK || code === STATUS_CODE.NO_SUCH_FILE) { Reload vscode It is not the most correct option but it works.
Seems a solution without downgrading here.
IT WORK MODERFOKER!!! THANKYOU!!!
It worked! Thank you so much!!!
Guys lets stop adding more “same here, downgrade worked” comments…
The new actually relevant issue is #919
Also: lets face it, this project seems abandoned, the last commit is 2 years old. The actual problem / bug is in the ssh2-streams library, which I think also won’t get any updates, like the author mentioned:
same issue here.
Could you provide the 1.2.7.vsix file so we can at least rollback in the meantime?
Just use my version that implement the new ssh2 v1.1.0 version that fix every problem 🙂 https://github.com/Natizyskunk/vscode-sftp/releases
ITS WORKING ! Thank you So much!
Same happening here. Win 10 x64, started on 1.56.0. Downgrade to 1.55.2 works OK.
Same, it is now working in 1.3.1.
@liximomo Nope, in my case update to 1.3.1 has resolved the issue.
Same issue for both commands: Download or Sync to Local Simultaneously SFTP:List is working absolutely fine and correctly displaying all directories and files.