vscode-remote-workspace icon indicating copy to clipboard operation
vscode-remote-workspace copied to clipboard

Reconnect when connection lost

Open JoaoBGusmao opened this issue 7 years ago • 13 comments

I'm facing an issue while developing using this extension: for any reason when I loose connection with the server, it won't reconnect automatically, forcing me to reopen the workspace. It would be a great feature to have

JoaoBGusmao avatar Jul 15 '18 22:07 JoaoBGusmao

@JoaoBGusmao

SFTP?

mkloubert avatar Aug 01 '18 19:08 mkloubert

Yes @mkloubert

JoaoBGusmao avatar Aug 03 '18 19:08 JoaoBGusmao

Hey - I'm seeing the same thing on sFTP. I need to close and re-open the workspace if I leave my Mac for an extended length of time.

Auto reconnect whenever I try an action, or a command to force a reconnect would be incredibly useful.

Other than that, great plugin - it's something I've been waiting for, for a while. :o)

contention avatar Aug 04 '18 07:08 contention

@JoaoBGusmao @contention

Have you tried keepAlive parameter?

mkloubert avatar Aug 06 '18 19:08 mkloubert

I have this same issue. I have to access the sftp over a VPN and whenever I disconnect/reconnect the VPN the workspace is hung and you have to close it and re-open it. You get the same thing too if you sleep the computer, move to a new wifi connection or anything else that disconnects you. Looking in the debug log it seems like the extension is oblivious to the fact that it's disconnected and doesn't try to reconnect:

INFO sftp://dev1-nzi1-1:22 - [28/Sep/2018:00:24:31 +0000] "DEBUG[SFTP]: Outgoing: Writing OPENDIR"
INFO sftp://dev1-nzi1-1:22 - [28/Sep/2018:00:24:34 +0000] "DEBUG[SFTP]: Outgoing: Writing OPENDIR"
INFO sftp://dev1-nzi1-1:22 - [28/Sep/2018:00:24:41 +0000] "DEBUG[SFTP]: Outgoing: Writing OPENDIR"
INFO sftp://dev1-nzi1-1:22 - [28/Sep/2018:00:30:10 +0000] "DEBUG[SFTP]: Outgoing: Writing OPENDIR"

Keepalive seems to solve a different problem, of keeping you from getting disconnected. There's always going to be things that disconnect you, having the connection automatically reconnect would be awesome. Failing that, a command we could run would still be a lot better than having to close, losing all unsaved changes, and re-open the workspace.

(Great extension BTW, even with this annoyance it's still pretty great)

jonathonsim avatar Sep 28 '18 00:09 jonathonsim

@mkloubert Sorry - I should have been clearer. By 'leaving my Mac for an extended period', I meant letting it go to sleep. My connection persists if my Max is awake.

@jonathonsim has explained the issue better. :o)

contention avatar Sep 28 '18 00:09 contention

This issue affects me also. Same was as others have described. Aside from that this extension is brilliant!

brentkelly avatar Oct 04 '18 08:10 brentkelly

This is a major limitation in this extension - if for any reason the connection drops you lose all unsaved work, and have to close and reopen all files/workspace.

@mkloubert Thanks for this extension, it's a revelation after a year of struggling with vscode/rmate!

alchemyconsulting avatar Oct 19 '18 07:10 alchemyconsulting

+1 Great extension, but having to close-reopen the workspace after PC sleep is a pain.

nemozny avatar Nov 08 '18 22:11 nemozny

Bit of further info with this - this problem is exacerbated by the fact that not only has the connection been lost, it does so silently. So there are no errors or anything. In practice this means you go on happily editing your code, until you start pulling you hair out wondering why none of your changes are taking effect. Finally the penny drops "ooooh somewhere along the line my connection must have gone down for a moment", you throw something at your computer screen, and then have to completely close VSCode & reopen everything again.

This makes the extension exceptionally fragile for working over SFTP.

brentkelly avatar Dec 16 '18 21:12 brentkelly

I think this is a major problem. This happens to me either and it really bothers me. This issue came up on Jul 2018 and no fix at all until now?

YHJ94 avatar Apr 04 '19 10:04 YHJ94

I had this problem too. I managed to fix it by setting the "keepAlive" to 5 sec. and now it is working fine. after 5 sec. the connection is disconnected and every time I save the file again it's reconnecting. "uploadOnSave": true, "keepAlive": 3,

azizyar avatar Jul 10 '19 09:07 azizyar

@azizyar Sounds good.

But anyway, MS implemented VSCode "native" remote development, so I suggest trying that one https://code.visualstudio.com/docs/remote/remote-overview

Plugin "Remote - SSH" by MS.

nemozny avatar Jul 10 '19 09:07 nemozny