Closed Andika7 closed 3 years ago
I downgraded my vscode to previous version. ( 1.55.2 ) It works well. And disabled automatic update. I will use this version until this is fixed.
download : https://code.visualstudio.com/updates/v1_55
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.
Thanks! But there are other failures and I'm not willing to downgrade my vscode. Since this extension seems not maintained any more, I'm trying some alternatives right now the 'ftp-sync'(https://github.com/lukasz-wronski/vscode-ftp-sync) I will update more info later
It sucks... I haven't found any ok alternatives
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.
Thanks!
But there are other failures and I'm not willing to downgrade my vscode.
Since this extension seems not maintained any more, I'm trying some alternatives right now the 'ftp-sync'(https://github.com/lukasz-wronski/vscode-ftp-sync)
I will update more info later
It sucks... I haven't found any ok alternatives
I haven't found alternatives that work or that remain maintained either. Most cases are extensions that have been outdated for quite some time. And in other cases, like "ftp-simple", haven't made it work.
Good solutions! It`s not a bug is feature
I solved mine by downgrading:
https://code.visualstudio.com/updates/v1_55
Still works well on version 1.55
Should we reach maintainers? Two days, and no updates from the creators/ maintainers?
+1
Should we reach maintainers? Two days, and no updates from the creators/ maintainers?
I tweeted to liximomo, let's wait for his action.
me toooo
Same problem here after the last VS Code Update
+1
Guys, please use 👍🏻 emoji on the comment you want to +1, instead of "+1" or a text such as "same problem" as a comment.
Should we reach maintainers? Two days, and no updates from the creators/ maintainers?
I tweeted to liximomo, let's wait for his action.
last commit was 1.5yrs ago I doubt whether he would respond..
Guys, it's most likely because of a regression on streams in the Node version that VSCode uses in 1.56.0
Also this extension is pretty much a wrapper of ssh2 package, so not much can be done here.
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.
thx !!!! same problem in VSCode 1.56.0
i have another error: bad descriptor, that's it
also, where is the .vscode folder located at?
edit: found it
downgrading works for me so...
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.
Fork it and PR. Maybe author will at least accept it as even if it's not perfect.
Just downgrade to VSC 1.55 in my opinion. Best solution to this issue
Just downgrade to VSC 1.55 in my opinion. Best solution to this issue
Best solution for today, but how about a year from now?
Same issue. And whilst upload works regardless - download/sync don't seem to work.
Is there any alternatives for now? Because for now downgrading works... but in the future updates will be needed....
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.
work for me ,thx!
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.
Thank you!
stream.Writable Change autoDestroy
option default to true in Nodejs V14.
add code
function WriteStream(sftp, path, options) {
if (options === undefined)
options = {};
else if (typeof options === 'string')
options = { encoding: options };
else if (options === null || typeof options !== 'object')
throw new TypeError('"options" argument must be a string or an object');
else
options = Object.create(options);
// For backwards compat do not emit close on destroy.
options.emitClose = false;
options.autoDestroy = false;
WritableStream.call(this, options);
stream.Writable Change
autoDestroy
option default to true in Nodejs V14. add codefunction WriteStream(sftp, path, options) { if (options === undefined) options = {}; else if (typeof options === 'string') options = { encoding: options }; else if (options === null || typeof options !== 'object') throw new TypeError('"options" argument must be a string or an object'); else options = Object.create(options); // For backwards compat do not emit close on destroy. options.emitClose = false; options.autoDestroy = false; WritableStream.call(this, options);
Thanks!
Same issue for me.
stream.Writable Change
autoDestroy
option default to true in Nodejs V14. add codefunction WriteStream(sftp, path, options) { if (options === undefined) options = {}; else if (typeof options === 'string') options = { encoding: options }; else if (options === null || typeof options !== 'object') throw new TypeError('"options" argument must be a string or an object'); else options = Object.create(options); // For backwards compat do not emit close on destroy. options.emitClose = false; options.autoDestroy = false; WritableStream.call(this, options);
To elaborate on this, I believe @sdir is suggesting to add options.autoDestroy = false;
to SFTP.js
(refer to lines 3387-3400), which is a part of the ssh2 package.
In the context of liximomo/vscode-sftp
, it looks like this is part of ssh2-streams, and you'd want to update:
~/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams/lib/sftp.js
I can confirm that this also works to resolve the issue when running VS Code 1.56.0
.
You'll find the NodeJS release notes here which documents the change in default behaviour of autoDestroy
. It was changed in this commit as part of this pull request. Per the comment changes as part of that commit, streams are now closed when an error
event is emitted, unless the autoDestroy
option is set to false
when first creating the stream.
stream.Writable Change
autoDestroy
option default to true in Nodejs V14. add codefunction WriteStream(sftp, path, options) { if (options === undefined) options = {}; else if (typeof options === 'string') options = { encoding: options }; else if (options === null || typeof options !== 'object') throw new TypeError('"options" argument must be a string or an object'); else options = Object.create(options); // For backwards compat do not emit close on destroy. options.emitClose = false; options.autoDestroy = false; WritableStream.call(this, options);
To elaborate on this, I believe @sdir is suggesting to add
options.autoDestroy = false;
toSFTP.js
(refer to lines 3387-3400), which is a part of the ssh2 package.In the context of
liximomo/vscode-sftp
, it looks like this is part of ssh2-streams, and you'd want to update:~/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams/lib/sftp.js
I can confirm that this also works to resolve the issue when running VS Code
1.56.0
.You'll find the NodeJS release notes here which documents the change in default behaviour of
autoDestroy
. It was changed in this commit as part of this pull request. Per the comment changes as part of that commit, streams are now closed when anerror
event is emitted, unless theautoDestroy
option is set tofalse
when first creating the stream.
Thanks! It's now working perfectly!
stream.Writable Change
autoDestroy
option default to true in Nodejs V14. add codefunction WriteStream(sftp, path, options) { if (options === undefined) options = {}; else if (typeof options === 'string') options = { encoding: options }; else if (options === null || typeof options !== 'object') throw new TypeError('"options" argument must be a string or an object'); else options = Object.create(options); // For backwards compat do not emit close on destroy. options.emitClose = false; options.autoDestroy = false; WritableStream.call(this, options);
To elaborate on this, I believe @sdir is suggesting to add
options.autoDestroy = false;
toSFTP.js
(refer to lines 3387-3400), which is a part of the ssh2 package.In the context of
liximomo/vscode-sftp
, it looks like this is part of ssh2-streams, and you'd want to update:~/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams/lib/sftp.js
I can confirm that this also works to resolve the issue when running VS Code
1.56.0
.You'll find the NodeJS release notes here which documents the change in default behaviour of
autoDestroy
. It was changed in this commit as part of this pull request. Per the comment changes as part of that commit, streams are now closed when anerror
event is emitted, unless theautoDestroy
option is set tofalse
when first creating the stream.
Thanks! It's now working perfectly!
At the same time, the following problems are also solved
When I use the
Upload Folder
directives to upload a folder, some files will fail to upload. This situation did not exist before VSCode was updated.
stream.Writable Change
autoDestroy
option default to true in Nodejs V14. add codefunction WriteStream(sftp, path, options) { if (options === undefined) options = {}; else if (typeof options === 'string') options = { encoding: options }; else if (options === null || typeof options !== 'object') throw new TypeError('"options" argument must be a string or an object'); else options = Object.create(options); // For backwards compat do not emit close on destroy. options.emitClose = false; options.autoDestroy = false; WritableStream.call(this, options);
To elaborate on this, I believe @sdir is suggesting to add
options.autoDestroy = false;
toSFTP.js
(refer to lines 3387-3400), which is a part of the ssh2 package. In the context ofliximomo/vscode-sftp
, it looks like this is part of ssh2-streams, and you'd want to update:~/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams/lib/sftp.js
I can confirm that this also works to resolve the issue when running VS Code
1.56.0
. You'll find the NodeJS release notes here which documents the change in default behaviour ofautoDestroy
. It was changed in this commit as part of this pull request. Per the comment changes as part of that commit, streams are now closed when anerror
event is emitted, unless theautoDestroy
option is set tofalse
when first creating the stream.Thanks! It's now working perfectly!
At the same time, the following problems are also solved
When I use the
Upload Folder
directives to upload a folder, some files will fail to upload. This situation did not exist before VSCode was updated.
This workaround works indeed. But I think should update code somewhere in this extension (vscode-sftp),may be set default options for calling the function WriteStream() in sftp.js.
stream.Writable Change
autoDestroy
option default to true in Nodejs V14. add codefunction WriteStream(sftp, path, options) { if (options === undefined) options = {}; else if (typeof options === 'string') options = { encoding: options }; else if (options === null || typeof options !== 'object') throw new TypeError('"options" argument must be a string or an object'); else options = Object.create(options); // For backwards compat do not emit close on destroy. options.emitClose = false; options.autoDestroy = false; WritableStream.call(this, options);
To elaborate on this, I believe @sdir is suggesting to add
options.autoDestroy = false;
toSFTP.js
(refer to lines 3387-3400), which is a part of the ssh2 package. In the context ofliximomo/vscode-sftp
, it looks like this is part of ssh2-streams, and you'd want to update:~/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams/lib/sftp.js
I can confirm that this also works to resolve the issue when running VS Code
1.56.0
. You'll find the NodeJS release notes here which documents the change in default behaviour ofautoDestroy
. It was changed in this commit as part of this pull request. Per the comment changes as part of that commit, streams are now closed when anerror
event is emitted, unless theautoDestroy
option is set tofalse
when first creating the stream.Thanks! It's now working perfectly! At the same time, the following problems are also solved
When I use the
Upload Folder
directives to upload a folder, some files will fail to upload. This situation did not exist before VSCode was updated.This workaround works indeed. But I think should update code somewhere in this extension (vscode-sftp),may be set default options for calling the function WriteStream() in sftp.js.
options.autoClose
default false but autoDestroy
not change. Maybe a bug for ssh-stream library.
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.
Thanks! The problem is solved.
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.Thanks! The problem is solved.
Thx! It's work.
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.Thanks! The problem is solved.
Thx! It's work.
Works!! But old files will also be synced again...
stream.Writable Change
autoDestroy
option default to true in Nodejs V14. add codefunction WriteStream(sftp, path, options) { if (options === undefined) options = {}; else if (typeof options === 'string') options = { encoding: options }; else if (options === null || typeof options !== 'object') throw new TypeError('"options" argument must be a string or an object'); else options = Object.create(options); // For backwards compat do not emit close on destroy. options.emitClose = false; options.autoDestroy = false; WritableStream.call(this, options);
To elaborate on this, I believe @sdir is suggesting to add
options.autoDestroy = false;
toSFTP.js
(refer to lines 3387-3400), which is a part of the ssh2 package. In the context ofliximomo/vscode-sftp
, it looks like this is part of ssh2-streams, and you'd want to update:~/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams/lib/sftp.js
I can confirm that this also works to resolve the issue when running VS Code
1.56.0
. You'll find the NodeJS release notes here which documents the change in default behaviour ofautoDestroy
. It was changed in this commit as part of this pull request. Per the comment changes as part of that commit, streams are now closed when anerror
event is emitted, unless theautoDestroy
option is set tofalse
when first creating the stream.Thanks! It's now working perfectly! At the same time, the following problems are also solved
When I use the
Upload Folder
directives to upload a folder, some files will fail to upload. This situation did not exist before VSCode was updated.This workaround works indeed. But I think should update code somewhere in this extension (vscode-sftp),may be set default options for calling the function WriteStream() in sftp.js.
options.autoClose
default false butautoDestroy
not change. Maybe a bug for ssh-stream library.
This fix seemed to solve the issue with uploading to FTP but downloads are still generating the error. Does anyone know if there's perhaps another instance of this code that needs adjusting in the same way for downloads/sync ations?
stream.Writable Change
autoDestroy
option default to true in Nodejs V14. add codefunction WriteStream(sftp, path, options) { if (options === undefined) options = {}; else if (typeof options === 'string') options = { encoding: options }; else if (options === null || typeof options !== 'object') throw new TypeError('"options" argument must be a string or an object'); else options = Object.create(options); // For backwards compat do not emit close on destroy. options.emitClose = false; options.autoDestroy = false; WritableStream.call(this, options);
To elaborate on this, I believe @sdir is suggesting to add
options.autoDestroy = false;
toSFTP.js
(refer to lines 3387-3400), which is a part of the ssh2 package. In the context ofliximomo/vscode-sftp
, it looks like this is part of ssh2-streams, and you'd want to update:~/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams/lib/sftp.js
I can confirm that this also works to resolve the issue when running VS Code
1.56.0
. You'll find the NodeJS release notes here which documents the change in default behaviour ofautoDestroy
. It was changed in this commit as part of this pull request. Per the comment changes as part of that commit, streams are now closed when anerror
event is emitted, unless theautoDestroy
option is set tofalse
when first creating the stream.Thanks! It's now working perfectly! At the same time, the following problems are also solved
When I use the
Upload Folder
directives to upload a folder, some files will fail to upload. This situation did not exist before VSCode was updated.This workaround works indeed. But I think should update code somewhere in this extension (vscode-sftp),may be set default options for calling the function WriteStream() in sftp.js.
options.autoClose
default false butautoDestroy
not change. Maybe a bug for ssh-stream library.This fix seemed to solve the issue with uploading to FTP but downloads are still generating the error. Does anyone know if there's perhaps another instance of this code that needs adjusting in the same way for downloads/sync ations?
In the same way, add options.autoDestroy = false;
in the ReadStream
function
In the same way, add options.autoDestroy = false; in the ReadStream function
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.js
for options.emitClose = false;
Add options.autoDestroy = false;
after both instances.
https://github.com/liximomo/vscode-sftp/issues/919#issuecomment-833347042
Same here! File upload well with 1 popup error!
Same here!
https://github.com/liximomo/vscode-sftp/issues/919#issuecomment-838586635
In the same way, add options.autoDestroy = false; in the ReadStream function
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.js
foroptions.emitClose = false;
- Add
options.autoDestroy = false;
after both instances.
Works here too, no more popup error!
it also corrupts files when uploading folder
In the same way, add options.autoDestroy = false; in the ReadStream function
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.js
foroptions.emitClose = false;
- Add
options.autoDestroy = false;
after both instances.
This is Perfect, I worked for me without downgrade
In the same way, add options.autoDestroy = false; in the ReadStream function
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.js
foroptions.emitClose = false;
- Add
options.autoDestroy = false;
after both instances.
superb, thank you!
this is the only one that will work for any case.
also thanks @sdir
if (code === STATUS_CODE.OK || code === STATUS_CODE.NO_SUCH_FILE) {
Work for me :P VSC 1.56.1
I've made a pull request on ssh2-streams repo to (temporary) fix this error : https://github.com/mscdex/ssh2-streams/pull/174
I've made a pull request on ssh2-streams repo to (temporary) fix this error : mscdex/ssh2-streams#174
Nice work - was on my to-do list for this weekend!
Please please.. Release an update!
I've made a pull request on ssh2-streams repo to (temporary) fix this error : mscdex/ssh2-streams#174
Can not work after local installation.
I've made a pull request on ssh2-streams repo to (temporary) fix this error : mscdex/ssh2-streams#174
Can not work after local installation.
You have to manually update it. There are two easy ways of doing it :
Method 1) a. download my modded v0.4.11 ssh2-streams module version from HERE ! b. go to $HOME/.vscode/extensions/liximomo.sftp-1.12.9/node_modules. (on Windows replace $HOME with %UserProfile%). c. delete "ssh2-streams" folder. d. extract here the downloaded archive (modded v0.4.11 ssh2-streams version). e. you should now have $HOME/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams (on Windows replace $HOME with %UserProfile%). d. restart Visual Studio Code.
Method 2) a. go to $HOME/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams/lib. (on Windows replace $HOME with %UserProfile%). b. open sftp.js file. c. search for "options.emitClose = false;" d. add "options.autoDestroy = false;" after both instances. e. restart Visual Studio Code.
Thanks @sdir! Work fine for me, MacOs, VSCode 1.56.2, sftp v 1.12.9.
Sadly this repo looks like it is not maintained any more. Any ideas for a good replacement for this vs-code-extensions?
Issue Type: Bug
while upload a file from local to remote, it show an error no such file and connection time out 10000. but the file is uploading without problem, just showing an error. This happen because I am update VS code version to 1.56.0.
Extension version: 1.12.9 VS Code version: Code 1.56.0 (cfa2e218100323074ac1948c885448fdf4de2a7f, 2021-05-04T22:09:06.405Z) OS version: Windows_NT x64 10.0.19041
System Info
|Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz (4 x 2712)| |GPU Status|2d_canvas: enabledgpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|11.87GB (5.66GB free)| |Process Argv|--crash-reporter-id 1ad20214-094e-4571-829c-44d1a08acd9f| |Screen Reader|no| |VM|0%|
A/B Experiments
``` vsliv368cf:30146710 vsreu685:30147344 python383:30185418 pythonvspyt602cf:30294773 vspor879:30202332 vspor708:30202333 vspor363:30204092 pythonvspyt639:30291489 pythontb:30283811 pythonvspyt551:30291414 vspre833cf:30267465 pythonptprofiler:30281270 vscnewfiletext:30294816 vshan820:30294714 pythondataviewer:30285071 vscus158:30286553 vscgsv2ct:30294353 ```