Vscode-remote-release: Double "Cannot reconnect" dialogs

Created on 26 Sep 2019  路  14Comments  路  Source: microsoft/vscode-remote-release

  • Connect to remote
  • Go into reconnection
  • Reconnection fails permanently, "Cannot reconnect, please reload" prompt appears
  • Click "Reload window" or "cancel". There is a second prompt behind that one.
needs-more-info

Most helpful comment

@alexdima here you go:

Kapture 2020-02-27 at 12 00 45

All 14 comments

Came here to report the exact same issue:

  • VSCode Version: 1.39.0-insider
  • Local OS Version: macOS Mojave 10.14.4
  • Remote OS Version: Ubuntu 18.04
  • Remote Extension/Connection Type: SSH

Repro GIF:
ezgif-2-b857ffacbd92

Steps to Reproduce:

  1. Connect to remote
  2. Unstable network/network connection is switched off, causing connection to be interrupted
  3. Connection is restored, prompt saying "Cannot connect. Please reload window." appears
  4. Click reload window
  5. Same prompt reappears before the window reloads

@roblourens I could not reproduce on Windows. I only get one reload and then the window reloads:

TO_UPLOAD

If you click cancel, does a second one show up?

Cancel is also happy:

TO_UPLOAD

It might not happen for all types of connection fail, I will pay more attention next time I see it.

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

What type of error were you throwing to test this @alexdima? Maybe it's only showing up for SSH. Others have been reporting it too

I see this every day with SSH connections, mostly on macOS but also a few times on Windows 10. Usually after the machine has been asleep for a while (overnight), but also occasionally with shorter periods (<1hr). The server side has a 18 hour timeout, so as far as I understand it, it should be able to reconnect fine in both of these cases?

Here are some logs from developer tools after running code --log trace. Hard to tell without timestamps, but the first reconnect might not be relevant:

log.ts:197   ERR [remote-connection] The time limit has been reached for a connection. Error:
log.ts:197   ERR Error: Time limit reached
    at remoteAgentConnection.ts:523
log.ts:185  INFO [remote-connection][ExtensionHost][b9966鈥[reconnect] A network error occured while trying to reconnect, will try again...
log.ts:173 TRACE Error: Time limit reached
    at remoteAgentConnection.ts:523
log.ts:185  INFO [remote-connection][ExtensionHost][b9966鈥[reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][ExtensionHost][b9966鈥[reconnect] resolving connection...
log.ts:185  INFO [remote-connection][ExtensionHost][b9966鈥[reconnect] connecting to 127.0.0.1:52570...
log.ts:173 TRACE [remote-connection][ExtensionHost][b9966鈥[reconnect][127.0.0.1:52570] 1/6. invoking socketFactory.connect().
log.ts:173 TRACE [remote-connection][ExtensionHost][b9966鈥[reconnect][127.0.0.1:52570] 2/6. socketFactory.connect() was successful.
log.ts:173 TRACE [remote-connection][ExtensionHost][b9966鈥[reconnect][127.0.0.1:52570] 3/6. sending AuthRequest control message.
log.ts:173 TRACE [remote-connection][ExtensionHost][b9966鈥[reconnect][127.0.0.1:52570] 4/6. received SignRequest control message.
log.ts:173 TRACE [remote-connection][ExtensionHost][b9966鈥[reconnect][127.0.0.1:52570] 5/6. sending ConnectionTypeRequest control message.
log.ts:173 TRACE [remote-connection][ExtensionHost][b9966鈥[reconnect][127.0.0.1:52570] 6/6. handshake finished, connection is up and running after 1485 ms!
log.ts:185  INFO [remote-connection][ExtensionHost][b9966鈥[reconnect] reconnected!
log.ts:179 DEBUG Terminal process ready (shellProcessId: 11918)
log.ts:179 DEBUG Terminal process exit (id: 23) with code 0
log.ts:179 DEBUG Terminal process exit (id: 23) state 5
log.ts:173 TRACE terminalInstance#dispose (id: 23)
log.ts:173 TRACE terminalInstance#ctor (id: 24) {name: "Check remote", executable: "/bin/sh", args: Array(2), cwd: h, waitOnExit: undefined,聽鈥
log.ts:185  INFO [remote-connection][Management   ][faaf4鈥[reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][faaf4鈥[reconnect] waiting for 5 seconds before reconnecting...
extensionHost.ts:211 Extension Host
extensionHost.ts:212 Debugger attached.
log.ts:185  INFO [remote-connection][Management   ][faaf4鈥[reconnect] resolving connection...
log.ts:173 TRACE CommandService#executeCommand setContext
log.ts:173 TRACE terminalInstance#ctor (id: 25) {name: "install", executable: "/bin/sh", args: Array(2), cwd: h, waitOnExit: undefined,聽鈥
log.ts:173 TRACE IPty#spawn /bin/sh (2)聽["-c", "ssh -T -D 52614 -o ConnectTimeout=15 kornholi-dev 鈥e; do sleep 180; echo -n ' '; done鈫碘喌EOSSH鈫礶xit 0"] {name: "xterm-256color", cwd: "/Users/kornholi", env: {鈥, cols: 0, rows: 0,聽鈥
log.ts:179 DEBUG Terminal process ready (shellProcessId: 68979)
log.ts:173 TRACE CommandService#executeCommand setContext
log.ts:173 TRACE terminalInstance#ctor (id: 26) {name: "Check remote", executable: "/bin/sh", args: Array(2), cwd: h, waitOnExit: undefined,聽鈥
log.ts:185  INFO [remote-connection][Management   ][faaf4鈥[reconnect] connecting to 127.0.0.1:52630...
log.ts:173 TRACE [remote-connection][Management   ][faaf4鈥[reconnect][127.0.0.1:52630] 1/6. invoking socketFactory.connect().
log.ts:173 TRACE [remote-connection][Management   ][faaf4鈥[reconnect][127.0.0.1:52630] 2/6. socketFactory.connect() was successful.
log.ts:173 TRACE [remote-connection][Management   ][faaf4鈥[reconnect][127.0.0.1:52630] 3/6. sending AuthRequest control message.
log.ts:173 TRACE [remote-connection][Management   ][faaf4鈥[reconnect][127.0.0.1:52630] 4/6. received SignRequest control message.
log.ts:173 TRACE [remote-connection][Management   ][faaf4鈥[reconnect][127.0.0.1:52630] 5/6. sending ConnectionTypeRequest control message.
log.ts:197   ERR [remote-connection][Management   ][faaf4鈥[reconnect][127.0.0.1:52630] received error control message when negotiating connection. Error:
log.ts:197   ERR Error: Connection error: Unknown reconnection token.
    at x (remoteAgentConnection.ts:553)
    at remoteAgentConnection.ts:189
    at c.fire (event.ts:582)
    at v.fire (ipc.net.ts:453)
    at t.PersistentProtocol._receiveMessage (ipc.net.ts:736)
    at ipc.net.ts:688
    at c.fire (event.ts:582)
    at g.acceptChunk (ipc.net.ts:239)
    at ipc.net.ts:200
    at Socket.t (ipc.net.ts:28)
    at Socket.emit (events.js:200)
    at addChunk (_stream_readable.js:294)
    at readableAddChunk (_stream_readable.js:275)
    at Socket.Readable.push (_stream_readable.js:210)
    at TCP.onStreamRead (internal/stream_base_commons.js:166)
log.ts:197   ERR [remote-connection][Management   ][faaf4鈥[reconnect] A permanent error occurred in the reconnecting loop! Will give up now! Error:
log.ts:197   ERR Error: Connection error: Unknown reconnection token.
    at x (remoteAgentConnection.ts:553)
    at remoteAgentConnection.ts:189
    at c.fire (event.ts:582)
    at v.fire (ipc.net.ts:453)
    at t.PersistentProtocol._receiveMessage (ipc.net.ts:736)
    at ipc.net.ts:688
    at c.fire (event.ts:582)
    at g.acceptChunk (ipc.net.ts:239)
    at ipc.net.ts:200
    at Socket.t (ipc.net.ts:28)
    at Socket.emit (events.js:200)
    at addChunk (_stream_readable.js:294)
    at readableAddChunk (_stream_readable.js:275)
    at Socket.Readable.push (_stream_readable.js:210)
    at TCP.onStreamRead (internal/stream_base_commons.js:166)
log.ts:173 TRACE DialogService#show Cannot reconnect. Please reload the window.
abstractExtensionService.ts:155 Extension host terminated unexpectedly. Code:  0  Signal:  null
_onExtensionHostCrashed @ abstractExtensionService.ts:155
_onExtensionHostCrashed @ extensionService.ts:381
_onExtensionHostCrashOrExit @ abstractExtensionService.ts:147
(anonymous) @ abstractExtensionService.ts:137
fire @ event.ts:582
_onExtHostConnectionLost @ remoteExtensionHostClient.ts:189
(anonymous) @ remoteExtensionHostClient.ts:122
fire @ event.ts:582
fire @ ipc.net.ts:453
acceptDisconnect @ ipc.net.ts:708
I @ remoteAgentConnection.ts:542
_gotoPermanentFailure @ remoteAgentConnection.ts:481
(anonymous) @ remoteAgentConnection.ts:356
triggerPermanentFailure @ remoteAgentConnection.ts:356
_runReconnectingLoop @ remoteAgentConnection.ts:444
processTicksAndRejections @ internal/process/task_queues.js:89
async function (async)
_runReconnectingLoop @ remoteAgentConnection.ts:421
_beginReconnecting @ remoteAgentConnection.ts:396
(anonymous) @ remoteAgentConnection.ts:380
fire @ event.ts:582
fire @ ipc.net.ts:453
_recvKeepAliveCheck @ ipc.net.ts:660
(anonymous) @ ipc.net.ts:666
setTimeout (async)
_recvKeepAliveCheck @ ipc.net.ts:664
endAcceptReconnection @ ipc.net.ts:704
(anonymous) @ remoteAgentConnection.ts:199
fire @ event.ts:582
fire @ ipc.net.ts:453
_receiveMessage @ ipc.net.ts:736
(anonymous) @ ipc.net.ts:688
fire @ event.ts:582
acceptChunk @ ipc.net.ts:239
(anonymous) @ ipc.net.ts:200
t @ ipc.net.ts:28
emit @ events.js:200
addChunk @ _stream_readable.js:294
readableAddChunk @ _stream_readable.js:275
Readable.push @ _stream_readable.js:210
onStreamRead @ internal/stream_base_commons.js:166
log.ts:173 TRACE IPty#kill
log.ts:179 DEBUG Terminal process exit (id: 22) with code 0
log.ts:179 DEBUG Terminal process exit (id: 22) state 5
log.ts:173 TRACE terminalInstance#dispose (id: 22)
log.ts:173 TRACE IPty#kill
log.ts:179 DEBUG Terminal process exit (id: 17) with code 0
log.ts:179 DEBUG Terminal process exit (id: 17) state 5
log.ts:173 TRACE terminalInstance#dispose (id: 17)

Hitting reload also affects developer tools, so I doubt there's anything useful here. The second spurious dialog was visible while everything reloaded, but hitting "reload window" on that one doesn't do anything.

If anyone has ideas on how to debug this, please let me know. I usually run into it a few times per day, but haven't found a quick way to reproduce.

@kornholi Could you please create a GIF if you encounter this? So you get a message box saying please reload, you click reload, and then you get another message box saying please reload?

@alexdima here you go:

Kapture 2020-02-27 at 12 00 45

hi, I am in windows 10 version 2004 (OS insider version 19041.207), My computer have this problem after a 1 hour power sleep. I met this for several months. I also find the privious version work fine. And actually I degrade Remote-WSL to 0.42.0, and vscode work fine

image

and 0.42.0 's log like this

Extension Host
extensionHost.ts:213 Debugger attached.
log.ts:185  INFO [remote-connection][ExtensionHost][2c7fd鈥[reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][ExtensionHost][2c7fd鈥[reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][37e8b鈥[reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:185  INFO [remote-connection][Management   ][37e8b鈥[reconnect] waiting for 5 seconds before reconnecting...
extensionHost.ts:212 Extension Host
extensionHost.ts:213 Debugger attached.
log.ts:185  INFO [remote-connection][ExtensionHost][2c7fd鈥[reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][37e8b鈥[reconnect] resolving connection...
log.ts:185  INFO [remote-connection][ExtensionHost][2c7fd鈥[reconnect] A promise cancelation error occured while trying to reconnect, will try again...
log.ts:185  INFO [remote-connection][ExtensionHost][2c7fd鈥[reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][37e8b鈥[reconnect] connecting to ::1:39371...
log.ts:185  INFO [remote-connection][ExtensionHost][2c7fd鈥[reconnect] resolving connection...
log.ts:185  INFO [remote-connection][ExtensionHost][2c7fd鈥[reconnect] connecting to ::1:39371...
bootstrap-window.js:209 [uncaught exception]: Error: read ECONNRESET
onUnexpectedError @ bootstrap-window.js:209
bootstrap-window.js:212 Error: read ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:183)
onUnexpectedError @ bootstrap-window.js:212
events.js:180 Uncaught Error: read ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:183)
log.ts:185  INFO [remote-connection][ExtensionHost][2c7fd鈥[reconnect] reconnected!
log.ts:197   ERR [remote-connection] The time limit has been reached for a connection. Error:
log.ts:197   ERR Error: Time limit reached
    at remoteAgentConnection.ts:523
log.ts:185  INFO [remote-connection][Management   ][37e8b鈥[reconnect] A network error occured while trying to reconnect, will try again...
log.ts:185  INFO [remote-connection][Management   ][37e8b鈥[reconnect] waiting for 5 seconds before reconnecting...
log.ts:185  INFO [remote-connection][Management   ][37e8b鈥[reconnect] resolving connection...
log.ts:185  INFO [remote-connection][Management   ][37e8b鈥[reconnect] connecting to ::1:39371...
log.ts:185 

Any updates? This problem still exists :(

Confirming I encounter this bug with:
VS-Code 1.47.1
Remote 0.51.0
client: OSX Catalina 10.15.5,
server: CentOS 7

Same here:

Version: 1.48.2 (system setup)
Commit: a0479759d6e9ea56afa657e454193f72aef85bd0
Date: 2020-08-25T10:13:11.295Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18362

I don't know how to copy a list of installed extensions to paste here in case it is relevant.

Was this page helpful?
0 / 5 - 0 ratings