code-server: Cannot reconnect. Please reload the window.
OS/Web Information
- Web Browser: Google Chrome 97.0.4692.71
- Local OS: windows 11
- Remote OS: centos 8
- Remote Architecture: amd64
code-server --version: 4.0.1
same of #1884
INFO [Service Worker] registered
log.ts:301 INFO [remote-connection][ExtensionHost][1a408…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:301 INFO [remote-connection][ExtensionHost][1a408…][reconnect] resolving connection...
log.ts:301 INFO [remote-connection][ExtensionHost][1a408…][reconnect] connecting to 10.1.1.182:443...
log.ts:301 INFO [remote-connection][ExtensionHost][1a408…][reconnect] reconnected!
log.ts:301 INFO [remote-connection][ExtensionHost][1a408…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:301 INFO [remote-connection][ExtensionHost][1a408…][reconnect] resolving connection...
log.ts:301 INFO [remote-connection][ExtensionHost][1a408…][reconnect] connecting to 10.1.1.182:443...
log.ts:301 INFO [remote-connection][ExtensionHost][1a408…][reconnect] reconnected!
log.ts:313 ERR Error received from starting extension host (kind: Remote)
log.ts:313 ERR The remote extenion host took longer than 60s to send its ready message.
log.ts:301 INFO [remote-connection][ExtensionHost][1a408…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
log.ts:301 INFO [remote-connection][ExtensionHost][1a408…][reconnect] resolving connection...
log.ts:301 INFO [remote-connection][ExtensionHost][1a408…][reconnect] connecting to 10.1.1.182:443...
log.ts:313 ERR [remote-connection][ExtensionHost][1a408…][reconnect][10.1.1.182:443] received error control message when negotiating connection. Error:
log.ts:313 ERR Error: Connection error: Unknown reconnection token (seen before)
at W (remoteAgentConnection.ts:732:17)
at remoteAgentConnection.ts:327:17
at l.fire (event.ts:577:16)
at u.fire (ipc.net.ts:511:19)
at r._receiveMessage (ipc.net.ts:873:27)
at ipc.net.ts:818:73
at l.fire (event.ts:577:16)
at d.acceptChunk (ipc.net.ts:284:21)
at ipc.net.ts:245:51
at browserSocketFactory.ts:197:39
log.ts:313 ERR [remote-connection][ExtensionHost][1a408…][reconnect] A permanent error occurred in the reconnecting loop! Will give up now! Error:
log.ts:313 ERR Error: Connection error: Unknown reconnection token (seen before)
at W (remoteAgentConnection.ts:732:17)
at remoteAgentConnection.ts:327:17
at l.fire (event.ts:577:16)
at u.fire (ipc.net.ts:511:19)
at r._receiveMessage (ipc.net.ts:873:27)
at ipc.net.ts:818:73
at l.fire (event.ts:577:16)
at d.acceptChunk (ipc.net.ts:284:21)
at ipc.net.ts:245:51
at browserSocketFactory.ts:197:39
abstractExtensionService.ts:644 Extension host (Remote) terminated unexpectedly. Code: 0, Signal: null
Steps to Reproduce
- edit
config.yamland add this:
bind-addr: 127.0.0.1:8080
auth: password
password: "12345"
cert: true
- run code-server:
code-server
Expected
code-server can be accessed via HTTPS and all expected features work.
Actual
Browser complains about about SSL certificate says “Cannot reconnect”
Screenshot
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 17
- Comments: 30 (8 by maintainers)
I was able to downgrade my Ubuntu install which is working fine now.
How do I downgrade my macOS install? Even though I pass the version, it tries to install the latest.
I have the same situation. Additionally it seems like some extensions can’t load their settings and don’t work.
I can confirm,
3.12.0does not exhibit the same behavior. No errors after downgrading.It happens to me too.
Still have the same issue with the newly released v4.0.2.
If I recall correctly there were some siginficant removals around code designed to handle the
certcase so it is possible this is another case of code removed that should not have been.Looking forward to it being fixed
code-server: v4.0.2 VS Code: v1.63.0 Commit: 5cdfe74686aa73e023f8354a9a6014eb30caa7dd Date: 2022-01-27T22:22:39Z Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43
Upgraded from 3.11 and now getting the “Cannot reconnect. Please reload window.” so often, it’s unusable. Going to try a downgrade.
Re-reading comments, I am using --cert option. [Service] Type=exec ExecStart=/usr/bin/code-server --cert /home/foo/ssl/some.crt --cert-key /home/foo/ssl/some.key --bind-addr 0.0.0.0:8080 Restart=always User=%i
Running on an ubuntu box, with deb install and upgrades since 3.9. Reverted to 3.12, no issues.
Stick with 3.12.0 until they release 4.0.3 where a patch for this issue is slated
This can be replicated & tested on any system (tested on macOS, Windows, and Linux) with the docker command below.
Log in with https on port 8080 with the password “temp” and bypass the untrusted cert warning. Just sit back and watch the Console logs and after about 2 minutes you will get the connection error. Even when I pass a valid trusted cert, I still get the reconnection errors.
If I remove the
--certflag and log in with http, I do not get any reconnection errors.For me, this behavior occurs on a fresh install when specifying a cert in config.yaml. Extensions successfully load with
cert: falseand I no longer get the “Cannot reconnect. Please reload the window.” popup.(edit: my environment) Pop!_OS 21.10 x86_64 Firefox 96.0b10
for me a fresh 4.0.2 (SSL) installation is not working with “$HOME/.config/code-server/config.yaml” file:
in any browser in Windows and MacOS. But more strange is that a fresh installation of 4.0.1 “curl -fsSL https://code-server.dev/install.sh | sh -s – --version=4.0.1” also is not working now too when it was before 4.0.2 was released.
As a workaround, I disabled SSL in 4.0.2 to use nginx as front-end with “$HOME/.config/code-server/config.yaml” file:
and it’s working.
Even with the extensions activated, I try to open the list of accounts and it keeps loading, until several seconds pass and the same error appears. I think the problem is there.
Can confirm same behavior using the
codercom/code-server:4.0.1docker image on docker.codercom/code-server:3.12.0works as intended.Counter point, I have never touched the
config.ymlfile when experiencing this issue. I went and checked mine to be sure and it is, I presume, default: