coder / code-server

VS Code in the browser
https://coder.com
MIT License
68.14k stars 5.6k forks source link

3.9.2 not working with code-server running in Kubernetes via Helm #3004

Closed jsjoeio closed 3 years ago

jsjoeio commented 3 years ago

Reporting on behalf of @nodesocket

OS/Web Information

Steps to Reproduce

  1. Upgrade Kubernetes images from 3.9.1 to 3.9.2.
  2. Then logged into my code-server and seeing these WebSocket close with status code 1006

Expected

code-server 3.9.2 should work

Actual

image

ERR [remote-connection][ExtensionHost][47c0b…][initial][<hidden>:80] socketFactory.connect() failed or timed out. Error:
log.ts:296   ERR Error: WebSocket close with status code 1006
    at WebSocket.<anonymous> (browserSocketFactory.ts:129)
browserSocketFactory.ts:162 WebSocket connection to 'wss://<hidden>/?reconnectionToken=2cb654bd-29f1-4132-b584-f156eb9a4df6&reconnection=false&skipWebSocketFrames=false' failed: 
create @ browserSocketFactory.ts:162
connect @ browserSocketFactory.ts:212
s @ remoteAgentConnection.ts:192
r @ remoteAgentConnection.ts:233
i @ remoteAgentConnection.ts:310
o @ remoteAgentConnection.ts:334
w @ remoteAgentConnection.ts:407
log.ts:296   ERR [remote-connection][Management   ][2cb65…][initial][<hidden>:80] socketFactory.connect() failed or timed out. Error:
log.ts:296   ERR Error: WebSocket close with status code 1006
    at WebSocket.<anonymous> (browserSocketFactory.ts:129)
log.ts:296   ERR [remote-connection] An error occurred in the very first connect attempt, it will be treated as a permanent error! Error:
log.ts:296   ERR Error: WebSocket close with status code 1006
    at WebSocket.<anonymous> (browserSocketFactory.ts:129)
log.ts:296   ERR Error: WebSocket close with status code 1006
    at WebSocket.<anonymous> (browserSocketFactory.ts:129)
log.ts:290  WARN Ignoring the error while validating workspace folder vscode-remote:/<hidden>/home/coder - WebSocket close with status code 1006
webWorkerExtensionHost.ts:125 The web worker extension host is started without an iframe sandbox!
start @ webWorkerExtensionHost.ts:125
Kn @ extensionHostManager.ts:67
_createInstance @ instantiationService.ts:110
createInstance @ instantiationService.ts:76
(anonymous) @ abstractExtensionService.ts:447
_startExtensionHosts @ abstractExtensionService.ts:446
_initialize @ abstractExtensionService.ts:411
(anonymous) @ extensionService.ts:74
Promise.then (async)
Xs @ extensionService.ts:74
_createInstance @ instantiationService.ts:110
_createServiceInstance @ instantiationService.ts:230
_createServiceInstanceWithOwner @ instantiationService.ts:219
_createAndCacheServiceInstance @ instantiationService.ts:208
_safeCreateAndCacheServiceInstance @ instantiationService.ts:151
_getOrCreateServiceInstance @ instantiationService.ts:135
get @ instantiationService.ts:54
initLayout @ layout.ts:255
(anonymous) @ workbench.ts:137
invokeFunction @ instantiationService.ts:61
startup @ workbench.ts:130
open @ web.main.ts:95
async function (async)
open @ web.main.ts:83
Se @ web.main.ts:359
g @ workbench.web.api.ts:498
(anonymous) @ workbench.ts:498
(anonymous) @ workbench.ts:505
r._invokeFactory @ loader.js:1114
r.complete @ loader.js:1124
r._onModuleComplete @ loader.js:1750
r._onModuleComplete @ loader.js:1762
r._resolve @ loader.js:1710
r.defineModule @ loader.js:1353
o @ loader.js:1638
v @ loader.js:2145
r._invokeFactory @ loader.js:1114
r.complete @ loader.js:1124
r._onModuleComplete @ loader.js:1750
r._onModuleComplete @ loader.js:1762
r._resolve @ loader.js:1710
r.defineModule @ loader.js:1353
p @ loader.js:1800
(anonymous) @ workbench.nls.js:7

Screenshot

Related

This issue can be reproduced in VS Code: Yes/No

jsjoeio commented 3 years ago

@nodesocket do you mind providing the following information so I can update the issue?

## OS/Web Information

- Web Browser: Chrome 89.0.4389.90/Firefox 87.0
- Local OS:
- Remote OS:
- Remote Architecture:
- `code-server --version`:

## Steps to Reproduce

1.
2.
3.
nodesocket commented 3 years ago

OS/Web Information

coder@code-server-6784d969bd-8w6rb:~$ code-server --version
3.9.2 109d2ce3247869eaeab67aa7e5423503ec9eb859

Steps to Reproduce

  1. I upgraded the Kubernetes images from 3.9.1 to 3.9.2.
  2. Then logged into my code-server and seeing these WebSocket close with status code 1006
jsjoeio commented 3 years ago

@bpmct I know you're a Kubernetes guru so if you have any interest in helping with this one, let us know!

bpmct commented 3 years ago

@nodesocket are you using the helm chart?

nodesocket commented 3 years ago

@bpmct correct, using https://github.com/cdr/code-server/tree/main/ci/helm-chart. I think the problem is not related to Kubernetes, Helm, or Docker, but the code-server files itself. See https://github.com/cdr/code-server/issues/2975#issuecomment-813567492

nodesocket commented 3 years ago

@bpmct I just started from scratch.

helm delete code-server --purge
kubectl delete secret code-server

And re-installed (after confirming it freshly created a new volume). To my surprise, I am having the same exact error and issue as above. I think something is actually broken in the 3.9.2 source code build.

Logs from the pod:

kube-master - ubuntu ➜  code-server git:(master) kubectl logs code-server-6784d969bd-xhdnx
[2021-04-08T04:24:46.071Z] info  Wrote default config file to ~/.config/code-server/config.yaml
[2021-04-08T04:24:47.171Z] info  code-server 3.9.2 109d2ce3247869eaeab67aa7e5423503ec9eb859
[2021-04-08T04:24:47.175Z] info  Using user-data-dir ~/.local/share/code-server
[2021-04-08T04:24:47.220Z] info  Using config file ~/.config/code-server/config.yaml
[2021-04-08T04:24:47.221Z] info  HTTP server listening on http://0.0.0.0:8080
[2021-04-08T04:24:47.221Z] info    - Authentication is enabled
[2021-04-08T04:24:47.221Z] info      - Using password from $PASSWORD
[2021-04-08T04:24:47.221Z] info    - Not serving HTTPS
[2021-04-08T04:25:40.751Z] error vscode Handshake timed out {"token":"dd253ab0-a995-4553-bc8b-77e1e918de2a"}
[2021-04-08T04:25:40.813Z] error vscode Handshake timed out {"token":"a9ceccab-e430-41dc-b07f-e1fa344df277"}
[2021-04-08T04:25:43.419Z] error vscode Handshake timed out {"token":"dc5aaa15-6932-4098-9618-9fffa54088ab"}
[2021-04-08T04:25:43.459Z] error vscode Handshake timed out {"token":"1c944433-dceb-418c-8120-a4efd857e1a9"}
[2021-04-08T04:25:48.414Z] error vscode Handshake timed out {"token":"c618d263-5497-4469-ab1c-fb38016d418c"}
[2021-04-08T04:25:48.538Z] error vscode Handshake timed out {"token":"60fd2509-ff77-421a-8664-94659b6e9a8c"}
[2021-04-08T04:28:36.995Z] error vscode Handshake timed out {"token":"9edb7201-e2b2-41c3-bf52-71a6e08bfaad"}
[2021-04-08T04:28:37.132Z] error vscode Handshake timed out {"token":"9d969550-c2e4-4ea5-97a9-81e52b3aa4c2"}
[2021-04-08T04:28:40.228Z] error vscode Handshake timed out {"token":"78dc08c2-5df2-46e1-ada5-b7b573034fb0"}
[2021-04-08T04:28:40.387Z] error vscode Handshake timed out {"token":"aca5f708-f6a7-400e-b806-96debe9f6bc0"}
[2021-04-08T04:30:45.567Z] error vscode Handshake timed out {"token":"9e8afe00-5a58-4065-bf65-cce326fb930d"}
[2021-04-08T04:30:45.721Z] error vscode Handshake timed out {"token":"65da0171-9565-4f3e-aaa1-977b798d8eb0"}
[2021-04-08T04:30:48.921Z] error vscode Handshake timed out {"token":"ac0ca772-3c91-44af-bdfa-7f3b33e90175"}
[2021-04-08T04:30:49.027Z] error vscode Handshake timed out {"token":"52ccf475-ac7a-4282-b1ac-56d4fea140f2"}
[2021-04-08T04:30:49.974Z] error vscode Handshake timed out {"token":"8fd1ef4e-e6e2-43bd-b777-20c1d75b63d9"}
[2021-04-08T04:30:50.058Z] error vscode Handshake timed out {"token":"9e15b49a-e3e3-4328-9a25-6af3acc792a1"}
bpmct commented 3 years ago

if you change the image to 3.9.1 in the helm chart do you still run into these issues?

Yamilquery commented 3 years ago

I have the same issue with 3.9.2.

I can't downgrade to 3.9.1 because is not available on homebrew.

jsjoeio commented 3 years ago

@yamajik you can uninstall with homebrew:

brew uninstall code-server

and reinstall with yarn/npm:

yarn global add code-server@3.9.1

npm i -g code-server@3.9.1
nodesocket commented 3 years ago

@bpmct just upgrade my Helm chart to use 3.9.3 and did a Helm upgrade and things are working now. So, it appears the fix added in 3.9.3 fixed the issue.

jsjoeio commented 3 years ago

Awesome! Thanks for checking and letting us know. Going to close this for now. Feel free to open a new issue or post in the v3.9.3 Discussion if you see anything funky.