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
Receiving the same issue here as well, completely fresh install. I've noticed a few things, similar to the above, which makes me believe this is the extension host again.
1, the reconnecting loop happens exactly 3 times.
2, Between the 2nd and 3rd reconnect loop, I'm getting the following error message in the console logs
The connection to wss://192.168.1.5:8500/?type=ExtensionHost&reconnectionToken=6661fa0b-34b7-457a-8498-104b5f0249be&reconnection=true&skipWebSocketFrames=false was interrupted while the page was loading.
3, After the 2nd reconnect, before the 3rd, I get the following errors:
Error received from starting extension host (kind: Remote)
The remote extenion host took longer than 60s to send its ready message.
For me, this behavior occurs on a fresh install when specifying a cert in config.yaml. Extensions successfully load with cert: false and I no longer get the "Cannot reconnect. Please reload the window." popup.
(edit: my environment)
Pop!_OS 21.10 x86_64
Firefox 96.0b10
I upgraded to 4.0.1 and now none of my extensions loaded and after about 5 seconds I receive the error and same console logs that the OP mentioned.
I commented out my cert configs in my config.yaml and reloaded and now it loads fine with all my extensions and no errors (except for the untrusted connection error).
@jsjoeio maybe this will be enough info for you to replicate the issue?
Counter point, I have never touched the config.yml file when experiencing this issue. I went and checked mine to be sure and it is, I presume, default:
I was able to downgrade my Ubuntu install which is working fine now.
> curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 3.12.0
Ubuntu 20.04.3 LTS
Installing v3.12.0 of the amd64 deb package from GitHub.
How do I downgrade my macOS install? Even though I pass the version, it tries to install the latest.
> curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 3.12.0
macOS v11.6.2
Installing latest from Homebrew.
Reacted by Michael Edlinger, Oleksandr Reshetniak, Joe Previte and Alaister
Reacted by Michael Edlinger, Oleksandr Reshetniak, Tanc and Joe Previte
Reacted by Michael Edlinger, Oleksandr Reshetniak and Joe Previte
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 --cert flag and log in with http, I do not get any reconnection errors.
Hi, I've been working during months w/ 4.0.1 ('ms-python.python', 'redhat.java' and 'kelvin.vscode-sshfs' extensions) deploying many different environments w/o any issues using "curl -fsSL https://code-server.dev/install.sh | sh" and systemctl and the following "$HOME/.config/code-server/config.yaml" file:
bind-addr: <server_ip>:443
auth: none
cert: true
after upgrading to 4.0.2 I'm getting the same error "Cannot reconnect. Please reload the window." in the web browser.
I started manually Code-Server w/ "code-server --verbose" and this is the log output:
[13:49:02] Started scanning user extensions
[13:49:02] Scanned user extensions: 0
[2022-01-29T13:49:18.050Z] debug 5 active connections
[2022-01-29T13:49:18.050Z] trace heartbeat
[13:49:19] [192.168.56.1][ae561d21][ExtensionHostConnection] - startParams language: en
[13:49:19] [192.168.56.1][ae561d21][ExtensionHostConnection] - startParams env: {"VSCODE_PROXY_URI":"https://192.168.56.10/proxy/{port}"}
[13:49:19] [192.168.56.1][ae561d21][ExtensionHostConnection] The client has reconnected.
[13:49:40] [192.168.56.1][ae561d21][ExtensionHostConnection] - startParams language: en
[13:49:40] [192.168.56.1][ae561d21][ExtensionHostConnection] - startParams env: {"VSCODE_PROXY_URI":"https://192.168.56.10/proxy/{port}"}
[13:49:40] [192.168.56.1][ae561d21][ExtensionHostConnection] The client has reconnected.
[13:50:00] [192.168.56.1][ae561d21][ExtensionHostConnection] - startParams language: en
[13:50:00] [192.168.56.1][ae561d21][ExtensionHostConnection] - startParams env: {"VSCODE_PROXY_URI":"https://192.168.56.10/proxy/{port}"}
[13:50:00] [192.168.56.1][ae561d21][ExtensionHostConnection] The client has reconnected.
[13:50:00] [192.168.56.1][ae561d21][ExtensionHostConnection] <10989> Extension Host Process exited with code: 0, signal: null.
[2022-01-29T13:50:18.051Z] debug 8 active connections
[2022-01-29T13:50:18.051Z] trace heartbeat
[13:50:20] [192.168.56.1][ae561d21][ExtensionHostConnection] - startParams language: en
[13:50:20] [192.168.56.1][ae561d21][ExtensionHostConnection] - startParams env: {"VSCODE_PROXY_URI":"https://192.168.56.10/proxy/{port}"}
[13:50:20] [192.168.56.1][ae561d21][ExtensionHostConnection] Unknown reconnection token (seen before).
[13:50:20] [192.168.56.1][165be397][ManagementConnection] The client has disconnected gracefully, so the connection will be disposed.
[2022-01-29T13:51:18.052Z] debug 7 active connections
[2022-01-29T13:51:18.053Z] trace heartbeat
and even I'm trying to rollback now to install Code-Server w/ the old version 4.0.1 in a totally new env and I don't know why now I'm having the same problem too as of 4.0.2 when it wasn't in the past ... it's supposed that the 4.0.1 code has not been modified, isn't it?
code-server: v4.0.2
VS Code: v1.63.0
Commit: 5cdfe74
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.
Just to clarify...this is making code-server unusable for everyone right?
Is there a certain browser it does work with? I work off of my macOS Chrome and my iPad (Safari) and getting this issue in both places.
for me a fresh 4.0.2 (SSL) installation is not working with "$HOME/.config/code-server/config.yaml" file:
bind-addr: <server_ip>:443
auth: none
cert: true
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:
I'm looking into this now. I was able to reproduce locally and updated the original issue with steps and a screenshot.
I need to continue investigating. I'll update this comment with my notes.
Notes
❌ The generated cert is not the issue
If you put cert: true in your config.yaml, we generate an SSL certificate for you. I used openssl to generate a certificate and passed that to code-server --cert <path-to-cert> --cert-key <path-to-key> and received the same results.
Therefore, I do not believe the generated certificate is the root cause of this issue.
❓ What about the place where code-server tells VS Code about the cert?
TODO - investigate
Asher gave me some pointers. I'm going to see if we can take a TDD approach to show this is a bug and then fix it.
Notes from debug with Asher 2/9
It seems that VS Code is getting stuck before sending the socket to the extension host (after calling socket drain). Not sure why, we'll need to investigate tomorrow.
Workarounds
use a tool like ngrok
It appears exposing the port with ngrok solves the problem (because ngrok has a valid SSL certificate).
We know that --cert worked in 3.12.0 and this bug did not exist. We wrote a new e2e test that proves this used to by testing it against a 3.12.0 build (video in issue description).
Activity
sobakaio commented on Jan 6, 2022
I have the same situation.
Additionally it seems like some extensions can't load their settings and don't work.
tenpaiyomi commented on Jan 6, 2022
Receiving the same issue here as well, completely fresh install. I've noticed a few things, similar to the above, which makes me believe this is the extension host again.
1, the reconnecting loop happens exactly 3 times.
2, Between the 2nd and 3rd reconnect loop, I'm getting the following error message in the console logs
3, After the 2nd reconnect, before the 3rd, I get the following errors:
tenpaiyomi commented on Jan 6, 2022
Additionally, reverting to 3.12.0, I do not exhibit the above behavior.
aleleba commented on Jan 6, 2022
It happens to me too.
jsjoeio commented on Jan 7, 2022
Can someone please provide reproduction steps? I'm running 4.0.1 on macOS with Brave and do not see this.
tenpaiyomi commented on Jan 7, 2022
@jsjoeio for me it was just installing the image, starting it up and loading up the UI. Latest Firefox, Win 10.
jsjoeio commented on Jan 7, 2022
I'm running from source directly on macOS + Brave and can't reproduce this :(
@code-asher any ideas?
onepunchdan commented on Jan 7, 2022
For me, this behavior occurs on a fresh install when specifying a cert in config.yaml. Extensions successfully load with cert: false and I no longer get the "Cannot reconnect. Please reload the window." popup.
(edit: my environment)
Pop!_OS 21.10 x86_64
Firefox 96.0b10
JtMotoX commented on Jan 8, 2022
@onepunchdan good catch!
I upgraded to 4.0.1 and now none of my extensions loaded and after about 5 seconds I receive the error and same console logs that the OP mentioned.
I commented out my cert configs in my config.yaml and reloaded and now it loads fine with all my extensions and no errors (except for the untrusted connection error).
@jsjoeio maybe this will be enough info for you to replicate the issue?
tenpaiyomi commented on Jan 8, 2022
Counter point, I have never touched the config.yml file when experiencing this issue. I went and checked mine to be sure and it is, I presume, default:
ochen1 commented on Jan 8, 2022
I can confirm, 3.12.0 does not exhibit the same behavior. No errors after downgrading.
JtMotoX commented on Jan 8, 2022
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.
vincentchu37 commented on Jan 8, 2022
Can confirm same behavior using the codercom/code-server:4.0.1 docker image on docker. codercom/code-server:3.12.0 works as intended.
JtMotoX commented on Jan 9, 2022
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 --cert flag and log in with http, I do not get any reconnection errors.
10 remaining items
hecnavsanz commented on Jan 29, 2022
Hi, I've been working during months w/ 4.0.1 ('ms-python.python', 'redhat.java' and 'kelvin.vscode-sshfs' extensions) deploying many different environments w/o any issues using "curl -fsSL https://code-server.dev/install.sh | sh" and systemctl and the following "$HOME/.config/code-server/config.yaml" file:
after upgrading to 4.0.2 I'm getting the same error "Cannot reconnect. Please reload the window." in the web browser.
I started manually Code-Server w/ "code-server --verbose" and this is the log output:
[13:49:02] Started scanning user extensions [13:49:02] Scanned user extensions: 0 [2022-01-29T13:49:18.050Z] debug 5 active connections [2022-01-29T13:49:18.050Z] trace heartbeat [13:49:19] [192.168.56.1][ae561d21][ExtensionHostConnection] - startParams language: en [13:49:19] [192.168.56.1][ae561d21][ExtensionHostConnection] - startParams env: {"VSCODE_PROXY_URI":"https://192.168.56.10/proxy/{port}"} [13:49:19] [192.168.56.1][ae561d21][ExtensionHostConnection] The client has reconnected. [13:49:40] [192.168.56.1][ae561d21][ExtensionHostConnection] - startParams language: en [13:49:40] [192.168.56.1][ae561d21][ExtensionHostConnection] - startParams env: {"VSCODE_PROXY_URI":"https://192.168.56.10/proxy/{port}"} [13:49:40] [192.168.56.1][ae561d21][ExtensionHostConnection] The client has reconnected. [13:50:00] [192.168.56.1][ae561d21][ExtensionHostConnection] - startParams language: en [13:50:00] [192.168.56.1][ae561d21][ExtensionHostConnection] - startParams env: {"VSCODE_PROXY_URI":"https://192.168.56.10/proxy/{port}"} [13:50:00] [192.168.56.1][ae561d21][ExtensionHostConnection] The client has reconnected. [13:50:00] [192.168.56.1][ae561d21][ExtensionHostConnection] <10989> Extension Host Process exited with code: 0, signal: null. [2022-01-29T13:50:18.051Z] debug 8 active connections [2022-01-29T13:50:18.051Z] trace heartbeat [13:50:20] [192.168.56.1][ae561d21][ExtensionHostConnection] - startParams language: en [13:50:20] [192.168.56.1][ae561d21][ExtensionHostConnection] - startParams env: {"VSCODE_PROXY_URI":"https://192.168.56.10/proxy/{port}"} [13:50:20] [192.168.56.1][ae561d21][ExtensionHostConnection] Unknown reconnection token (seen before). [13:50:20] [192.168.56.1][165be397][ManagementConnection] The client has disconnected gracefully, so the connection will be disposed. [2022-01-29T13:51:18.052Z] debug 7 active connections [2022-01-29T13:51:18.053Z] trace heartbeatand even I'm trying to rollback now to install Code-Server w/ the old version 4.0.1 in a totally new env and I don't know why now I'm having the same problem too as of 4.0.2 when it wasn't in the past ... it's supposed that the 4.0.1 code has not been modified, isn't it?
Thanx again.
jsjoeio commented on Jan 31, 2022
@kexirong thanks for the notes! I'm not 100% what the issue is. We'll need to take a closer look.
tomsherrod commented on Feb 1, 2022
code-server: v4.0.2
VS Code: v1.63.0
Commit: 5cdfe74
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.
invictus2010 commented on Feb 4, 2022
Just to clarify...this is making code-server unusable for everyone right?
Is there a certain browser it does work with? I work off of my macOS Chrome and my iPad (Safari) and getting this issue in both places.
vincentchu37 commented on Feb 4, 2022
Stick with 3.12.0 until they release 4.0.3 where a patch for this issue is slated
hecnavsanz commented on Feb 4, 2022
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.
jsjoeio commented on Feb 8, 2022
I'm looking into this now. I was able to reproduce locally and updated the original issue with steps and a screenshot.
I need to continue investigating. I'll update this comment with my notes.
Notes
❌ The generated cert is not the issue
If you put cert: true in your config.yaml, we generate an SSL certificate for you. I used openssl to generate a certificate and passed that to code-server --cert <path-to-cert> --cert-key <path-to-key> and received the same results.
Therefore, I do not believe the generated certificate is the root cause of this issue.
❓ What about the place where code-server tells VS Code about the cert?
TODO - investigate
Asher gave me some pointers. I'm going to see if we can take a TDD approach to show this is a bug and then fix it.
Notes from debug with Asher 2/9
It seems that VS Code is getting stuck before sending the socket to the extension host (after calling socket drain). Not sure why, we'll need to investigate tomorrow.
Workarounds
use a tool like ngrok
It appears exposing the port with ngrok solves the problem (because ngrok has a valid SSL certificate).
i.e. ngrok http https://localhost:8080 -> gives you something like https://f2c9-65-127-76-6.ngrok.io/
2/10/22
What do we know so far?
We know that --cert worked in 3.12.0 and this bug did not exist. We wrote a new e2e test that proves this used to by testing it against a 3.12.0 build (video in issue description).
kkv0id commented on Feb 14, 2022
Looking forward to it being fixed