coder / code-server

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

Blank page: error vscode Handshake timed out #3027

Closed hakanu closed 2 years ago

hakanu commented 3 years ago

OS/Web Information

Steps to Reproduce

  1. SSH in to raspberry pi
  2. Run this curl -fsSL https://code-server.dev/install.sh | sh
  3. Takes 22m usually
  4. Go to hosted site through local network, it's blank and in the logs it gives this error:
    error vscode Handshake timed out {"token": "..."}
  5. It was working fine before the upgrade.
  6. Maybe you can also add some fresh install instructions.

Expected

Browser should show coder as usual

Actual

Blank page.

Screenshot

Screenshot from 2021-04-04 02-11-43

Notes

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

jsjoeio commented 3 years ago

Hey @hakanu - sorry to hear you're having issues. Thanks for the report!

Can you verify if you experience this same issue using code-server 3.9.1?

Possibly related:

hakanu commented 3 years ago

No it's with 3.9.2 the latest version as I mentioned in the first comment.

jsjoeio commented 3 years ago

@hakanu yes, I saw that. I'm wondering if you have a workaround for now :) Thanks for confirming.

hakanu commented 3 years ago

no worries :)

Unforunately not :/ It was working fine 2 versions before though. I should not have upgraded an already working system.

Is there a way to totally clean up the system and re-install?

I tried npm uninstall code-server and retry but no help. Any idea is welcome.

jsjoeio commented 3 years ago

Hmm..interesting.

If you installed globally with npm, you should be able to do:

  1. npm uninstall -g code-server
  2. npm install -g code-server@3.9.0 or which ever version was working before

Hope that helps!

hakanu commented 3 years ago

Thanks! same with 3.9.1 and 3.9.0 :/ I feel like something is wrong with the underlying vscode itself. Any suggestions like purging vscode from the system and then re-install?

lokhmakov commented 3 years ago

Same with install in Google Cloud Shell.

jsjoeio commented 3 years ago

same with 3.9.1 and 3.9.0 :/

Argh. How about 3.8.1?

I feel like something is wrong with the underlying vscode itself

You may be able to go inside code-server and go inside the lib/vscode directory and run npm rebuild.

It looks like someone had a similar issue in February - see thread

jkcoxson commented 3 years ago

I am able to reproduce this on the newest build, the log is full of handshake errors and visual studio ends up with a blank screen.

jkcoxson commented 3 years ago

I can confirm this is affected on a clean install of 3.8.1. Is there some sort of dependency that broke it?

jsjoeio commented 3 years ago

I am able to reproduce this on the newest build,

Thanks for confirming @jkcoxson! I assume you're on a similar set up? i.e.

I can confirm this is affected on a clean install of 3.8.1. Is there some sort of dependency that broke it?

So 3.8.1 has this issue too? Hmm.. Yeah it must be. My guess would be an issue with an underlying native module.

This thread may or may not have relevant information for y'all.

jkcoxson commented 3 years ago

No, I'm using x64, on Ubuntu

jkcoxson commented 3 years ago

Is there anything I can do to at least get something up and running? This is my main way to do my job at the moment, and something would be better than nothing. But if not, I'll be patient. Thanks for your work on this project.

jsjoeio commented 3 years ago

Hmm...3.9.1 should work on Linux.

Have you seen the deploy code-server guides? As a workaround, I would suggest using 3.9.1 on Railway. That should unblock you and help you get something working quickly. Sorry for blocking you and thank you for having patience + trying to help us figure this out!

jkcoxson commented 3 years ago

I was able to completely purge 3.9.2 with the help of Ben and reinstall using 3.9.1 and it worked for me. If it helps, I'm using Safari on my iPad, but it also didn't work on Chrome.

jsjoeio commented 3 years ago

Hi can you try upgrade to 3.9.3 and letting us know if you're still experiencing the same issue?

Feel free to post in the release discussion as well.

wingzero0 commented 3 years ago

@jsjoeio I get the same error in 3.9.2, 3.9.3, but not before 3.9.1

Here is my running log from 3.9.3, I run it in docker, base image is ubuntu:20.04, docker host is also ubuntu:20.04. but my docker host worked behind my company firewall, not sure whether if it is related.

[2021-04-09T04:16:02.521Z] info  code-server 3.9.3 fe2dc2deb08e378069891b622bb62ad1d261d1b1
[2021-04-09T04:16:02.525Z] info  Using user-data-dir ~/.local/share/code-server
[2021-04-09T04:16:02.543Z] info  Using config file ~/.config/code-server/config.yaml
[2021-04-09T04:16:02.543Z] info  HTTP server listening on http://0.0.0.0:9000
[2021-04-09T04:16:02.543Z] info    - Authentication is enabled
[2021-04-09T04:16:02.544Z] info      - Using password from ~/.config/code-server/config.yaml
[2021-04-09T04:16:02.544Z] info    - Not serving HTTPS
  ERR /root/.local/share/code-server/extensions [Error: ENOENT: no such file or directory, scandir '/root/.local/share/code-server/extensions'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/root/.local/share/code-server/extensions'
}
[2021-04-09T04:16:22.575Z] error Failed to get latest version {"error":"self signed certificate in certificate chain"}
Error: invalid distance too far back
    at Zlib.zlibOnError [as onerror] (zlib.js:182:17) {
  errno: -3,
  code: 'Z_DATA_ERROR'
}
[2021-04-09T04:16:22.605Z] warn  vscode invalid distance too far back
[2021-04-09T04:16:32.583Z] error vscode Handshake timed out {"token":"5f4a34e0-243b-4f9e-8b90-037747c124b5"}
  ERR /root/.local/share/code-server/extensions [Error: ENOENT: no such file or directory, scandir '/root/.local/share/code-server/extensions'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/root/.local/share/code-server/extensions'
}
[2021-04-09T04:16:46.315Z] error Failed to get latest version {"error":"self signed certificate in certificate chain"}
Error: invalid distance too far back
    at Zlib.zlibOnError [as onerror] (zlib.js:182:17) {
  errno: -3,
  code: 'Z_DATA_ERROR'
}
[2021-04-09T04:16:46.367Z] warn  vscode invalid distance too far back
[2021-04-09T04:16:56.344Z] error vscode Handshake timed out {"token":"4280cead-0a6f-4cbc-8485-5c2d5e43a63d"}

This is my Dockerfile without company CA cert. (sorry that I cannot attach the ca cert to reproduce the environment) https://github.com/wingzero0/codeserverUbuntu/blob/master/Dockerfile

wingzero0 commented 3 years ago

I made a docker-compose script for easier to describe my environment.

I pushed my docker image to docker hub https://hub.docker.com/repository/docker/wingzzz2003/codeserver_ubuntu tag 3.9.3 was built today and tag 3.9.1 was built 2 weeks ago

This is my docker-compose script https://github.com/wingzero0/codeserverUbuntu/blob/master/docker-compose.yml

3.9.3 showed 'error vscode Handshake timed out' log from 3.9.3

[2021-04-09T05:18:16.016Z] info  code-server 3.9.3 fe2dc2deb08e378069891b622bb62ad1d261d1b1
[2021-04-09T05:18:16.017Z] info  Using user-data-dir ~/.local/share/code-server
[2021-04-09T05:18:16.032Z] info  Using config file ~/.config/code-server/config.yaml
[2021-04-09T05:18:16.032Z] info  HTTP server listening on http://0.0.0.0:8080
[2021-04-09T05:18:16.033Z] info    - Authentication is enabled
[2021-04-09T05:18:16.033Z] info      - Using password from ~/.config/code-server/config.yaml
[2021-04-09T05:18:16.033Z] info    - Not serving HTTPS
  ERR /root/.local/share/code-server/extensions [Error: ENOENT: no such file or directory, scandir '/root/.local/share/code-server/extensions'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/root/.local/share/code-server/extensions'
}
Error: invalid distance too far back
    at Zlib.zlibOnError [as onerror] (zlib.js:182:17) {
  errno: -3,
  code: 'Z_DATA_ERROR'
}
[2021-04-09T05:18:30.976Z] error Failed to get latest version {"error":"self signed certificate in certificate chain"}
[2021-04-09T05:18:30.979Z] warn  vscode invalid distance too far back
[2021-04-09T05:18:40.967Z] error vscode Handshake timed out {"token":"1d7b2efe-1532-4787-bc45-bad0f53c39a0"}

But 3.9.1 run fine. (to run 3.9.1, just simply changing docker-compose script to reference to tag 3.9.1) log from 3.9.1

[2021-04-09T05:19:27.252Z] info  code-server 3.9.1 e0203f2a36c9b7036fefa50eec6cf8fa36c5c015
[2021-04-09T05:19:27.255Z] info  Using user-data-dir ~/.local/share/code-server
[2021-04-09T05:19:27.272Z] info  Using config file ~/.config/code-server/config.yaml
[2021-04-09T05:19:27.272Z] info  HTTP server listening on http://0.0.0.0:8080
[2021-04-09T05:19:27.273Z] info    - Authentication is enabled
[2021-04-09T05:19:27.273Z] info      - Using password from ~/.config/code-server/config.yaml
[2021-04-09T05:19:27.274Z] info    - Not serving HTTPS
[2021-04-09T05:19:53.710Z] error Failed to get latest version {"error":"self signed certificate in certificate chain"}
jsjoeio commented 3 years ago

This is my docker-compose script

I like how simple/straightforward your docker-compose script is!

Thanks for the logs.

Bummer. Okay this is probably a separate issue then. We'll investigate.

danyhoron commented 3 years ago

I encountered the same issue in Chrome and Brave Browser on MacOS (on v3.9.2 and v3.9.3 but not on v3.9.1). v3.9.3 works on Safari though.

jsjoeio commented 3 years ago

Hmm...I am on macOS and not able to reproduce with 3.9.3

image

@danyhoron do you see any logs in the browser or when running code-server --log debug with 3.9.3?

danyhoron commented 3 years ago

My instance runs in a docker container on another machine and I have an IIS (windows server) reverse proxy. Here are the logs in Chrome: image And here are the logs in docker: image

danyhoron commented 3 years ago

If I'm bypassing the reverse proxy and go straight to the docker instance it works in both Chrome and Brave.

Starting w/ v.3.9.2 it stopped working when using the reverse proxy.

jsjoeio commented 3 years ago

Ah, so maybe something broke in 3.9.3 with the reverse proxy. That at least gives us a place to start investigating. Thanks so much for the logs and screenshots @danyhoron! Super helpful 🙌

hakanu commented 3 years ago

My setup doesn't have any reverse proxy, locally it runs and but fails to handshake.

I'm suspicious about the raspberry pi's 32 bit ARM architecture. Because 3.9.2 works fine on my intel desktop on ubuntu 64 bit

12io commented 3 years ago

My setup doesn't have any reverse proxy, locally it runs and but fails to handshake.

I'm suspicious about the raspberry pi's 32 bit ARM architecture. Because 3.9.2 works fine on my intel desktop on ubuntu 64 bit

This could also be the case. I just installed it like in the past hour on a Pi 4 with armv7l after installing node12. So it took the npm way of installing it. Created a self signed cert due to testing and got the same error. But also there is a warning. I don't know how much this is helpful, but there is also a complaint about zlib. Here a short "full" log from "Starting code-server" to "visit the page":

pi@picroft:~ $ code-server
[2021-04-16T18:32:19.757Z] info  code-server 3.9.3 fe2dc2deb08e378069891b622bb62ad1d261d1b1
[2021-04-16T18:32:19.761Z] info  Using user-data-dir ~/.local/share/code-server
[2021-04-16T18:32:19.827Z] info  Using config file ~/.config/code-server/config.yaml
[2021-04-16T18:32:19.828Z] info  HTTP server listening on http://0.0.0.0:8443
[2021-04-16T18:32:19.828Z] info    - Authentication is disabled
[2021-04-16T18:32:19.828Z] info    - Using certificate for HTTPS: ~/mycroft-snakeoil.pem
Error: invalid distance too far back
    at Zlib.zlibOnError [as onerror] (zlib.js:182:17) {
  errno: -3,
  code: 'Z_DATA_ERROR'
}
[2021-04-16T18:32:43.965Z] warn  vscode invalid distance too far back
[2021-04-16T18:32:53.943Z] error vscode Handshake timed out {"token":"d56b2e87-8fb2-4d29-be42-f09857b8e683"}
Error: invalid distance too far back
    at Zlib.zlibOnError [as onerror] (zlib.js:182:17) {
  errno: -3,
  code: 'Z_DATA_ERROR'
}
[2021-04-16T18:32:54.396Z] warn  vscode invalid distance too far back
[2021-04-16T18:33:04.387Z] error vscode Handshake timed out {"token":"f8597587-f7df-40bd-b812-8b57f958dda4"}
snoglobe commented 3 years ago

I'm getting this on the latest ver. without any Zlib errors, just shows a blank screen and shows this in systemctl status:

Apr 18 12:36:36 neptune-2 systemd[1]: Starting code-server...
Apr 18 12:36:37 neptune-2 systemd[1]: Started code-server.
Apr 18 12:36:39 neptune-2 code-server[32046]: [2021-04-18T16:36:39.145Z] info  code-server 3.9.3 fe2dc2deb08e378069891b622bb62ad1d261d1b1
Apr 18 12:36:39 neptune-2 code-server[32046]: [2021-04-18T16:36:39.149Z] info  Using user-data-dir ~/.local/share/code-server
Apr 18 12:36:39 neptune-2 code-server[32046]: [2021-04-18T16:36:39.225Z] info  Using config file ~/.config/code-server/config.yaml
Apr 18 12:36:39 neptune-2 code-server[32046]: [2021-04-18T16:36:39.226Z] info  HTTP server listening on http://0.0.0.0:8080
Apr 18 12:36:39 neptune-2 code-server[32046]: [2021-04-18T16:36:39.227Z] info    - Authentication is enabled
Apr 18 12:36:39 neptune-2 code-server[32046]: [2021-04-18T16:36:39.227Z] info      - Using password from ~/.config/code-server/config.yaml
Apr 18 12:36:39 neptune-2 code-server[32046]: [2021-04-18T16:36:39.228Z] info    - Using certificate for HTTPS: ~/.local/share/code-server/localhost.crt
Apr 18 12:37:03 neptune-2 code-server[32046]: [2021-04-18T16:37:03.539Z] error vscode Handshake timed out {"token":"7525f46e-987a-4acc-bb59-27c95bac7890"}

I've reinstalled twice and I've upgraded to Debian Unstable. I'm on amd64, latest debian unstable.

owocean commented 3 years ago

Latest version, installed today on Arch WSL 2

[2021-04-19T18:16:05.358Z] info  code-server 3.9.3 fe2dc2deb08e378069891b622bb62ad1d261d1b1
[2021-04-19T18:16:05.360Z] info  Using user-data-dir ~/.local/share/code-server
[2021-04-19T18:16:05.371Z] info  Using config file ~/.config/code-server/config.yaml
[2021-04-19T18:16:05.372Z] info  HTTP server listening on http://127.0.0.1:8080
[2021-04-19T18:16:05.372Z] info    - Authentication is enabled
[2021-04-19T18:16:05.372Z] info      - Using password from ~/.config/code-server/config.yaml
[2021-04-19T18:16:05.372Z] info    - Not serving HTTPS
[2021-04-19T18:16:20.747Z] error vscode Handshake timed out {"token":"2e70bc73-5d43-4227-9352-3417ef02d3d5"}

I've reinstalled multiple times and looked everywhere, not sure what is causing this problem. Same error as all of you, I just need to be able to do work.

jsjoeio commented 3 years ago

@owocean do you get the same error on 3.9.2 or 3.9.1?

And for alternative ways to get code-server running, take a look at the deploy-code-server guide.

We're still investigating this issue in the meantime.

owocean commented 3 years ago

I get the same error on 3.9.3, 3.9.2, and 3.9.1 I cannot afford alternative hosting

I have been installing using the binaries provided in the releases, as I cannot use makepkg or yum on my WSL

jsjoeio commented 3 years ago

I get the same error on 3.9.3, 3.9.2, and 3.9.1

Thanks for confirming!

I cannot afford alternative hosting

Completely understand. There are three free options - Railway, Heroku and Azure - offered in our guide.

Keep an eye on the this issue in the meantime.

code-asher commented 3 years ago

We might be able to get some helpful information with --log trace. It could also be helpful to get the corresponding browser logs along with the server side ones.

snoglobe commented 3 years ago

I found out that if I connect to my server through it's local IP then I don't have any issues, but if I go to the domain name that I have pointed to my reverse proxy which does its magic and brings me to the code-server instance I get the blank screen. I can see the password screen just fine, but the actual app is blank.

snoglobe commented 3 years ago
[2021-04-22T01:31:38.728Z] trace child:25744 got message {"message":{"type":"handshake","args":{"_":[],"bind-addr":"0.0.0.0:8080","auth":"password","password":"testpassword","cert":{"value":"/home/mason/.local/share/code-server/localhost.crt"},"config":"/home/mason/.config/code-server/config.yaml","log":"trace","user-data-dir":"/home/mason/.local/share/code-server","extensions-dir":"/home/mason/.local/share/code-server/extensions","verbose":true,"host":"0.0.0.0","port":8080,"cert-key":"/home/mason/.local/share/code-server/localhost.key","proxy-domain":[],"usingEnvPassword":false,"usingEnvHashedPassword":false}}}
[2021-04-22T01:31:38.735Z] info  code-server 3.9.3 fe2dc2deb08e378069891b622bb62ad1d261d1b1
[2021-04-22T01:31:38.736Z] info  Using user-data-dir ~/.local/share/code-server
[2021-04-22T01:31:38.736Z] trace Using extensions-dir ~/.local/share/code-server/extensions
[2021-04-22T01:31:38.795Z] info  Using config file ~/.config/code-server/config.yaml
[2021-04-22T01:31:38.796Z] info  HTTP server listening on http://0.0.0.0:8080
[2021-04-22T01:31:38.796Z] info    - Authentication is enabled
[2021-04-22T01:31:38.796Z] info      - Using password from ~/.config/code-server/config.yaml
[2021-04-22T01:31:38.797Z] info    - Using certificate for HTTPS: ~/.local/share/code-server/localhost.crt
[2021-04-22T01:31:46.272Z] trace heartbeat
[2021-04-22T01:31:46.286Z] debug forking vs code...
[2021-04-22T01:31:47.259Z] trace got message {"message":{"type":"ready"}}
[2021-04-22T01:31:47.260Z] debug setting up vs code...
[2021-04-22T01:31:47.265Z] debug vscode got message from code-server {"type":"init"}
[2021-04-22T01:31:47.269Z] trace vscode code-server message content {"message":{"type":"init","id":"XMeHFsvIbURxlkhcurD219W4","options":{"args":{"_":[],"bind-addr":"0.0.0.0:8080","auth":"password","password":"testpassword","cert":{"value":"/home/mason/.local/share/code-server/localhost.crt"},"config":"/home/mason/.config/code-server/config.yaml","log":"trace","user-data-dir":"/home/mason/.local/share/code-server","extensions-dir":"/home/mason/.local/share/code-server/extensions","verbose":true,"host":"0.0.0.0","port":8080,"cert-key":"/home/mason/.local/share/code-server/localhost.key","proxy-domain":[],"usingEnvPassword":false,"usingEnvHashedPassword":false},"remoteAuthority":"code.snwy.me"}}}
[2021-04-22T01:31:47.462Z] trace got message {"message":{"type":"options","id":"XMeHFsvIbURxlkhcurD219W4","options":{"workbenchWebConfiguration":{"remoteAuthority":"code.snwy.me","logLevel":0,"workspaceProvider":{"payload":[["userDataPath","/home/mason/.local/share/code-server"],["enableProposedApi","[]"]]}},"remoteUserDataUri":{"$mid":1,"path":"/home/mason/.local/share/code-server","scheme":"vscode-remote","authority":"code.snwy.me"},"productConfiguration":{"nameShort":"code-server","nameLong":"code-server","applicationName":"code-oss","dataFolderName":".vscode-oss","win32MutexName":"vscodeoss","licenseName":"MIT","licenseUrl":"https://github.com/microsoft/vscode/blob/main/LICENSE.txt","win32DirName":"Microsoft Code OSS","win32NameVersion":"Microsoft Code OSS","win32RegValueName":"CodeOSS","win32AppId":"{{E34003BB-9E10-4501-8C11-BE3FAA83F23F}","win32x64AppId":"{{D77B7E06-80BA-4137-BCF4-654B95CCEBC5}","win32arm64AppId":"{{D1ACE434-89C5-48D1-88D3-E2991DF85475}","win32UserAppId":"{{C6065F05-9603-4FC4-8101-B9781A25D88E}","win32x64UserAppId":"{{CC6B787D-37A0-49E8-AE24-8559A032BE0C}","win32arm64UserAppId":"{{3AEBF0C8-F733-4AD4-BADE-FDB816D53D7B}","win32AppUserModelId":"Microsoft.CodeOSS","win32ShellNameShort":"C&ode - OSS","darwinBundleIdentifier":"com.visualstudio.code.oss","linuxIconName":"com.visualstudio.code.oss","licenseFileName":"LICENSE.txt","reportIssueUrl":"https://github.com/cdr/code-server/issues/new","urlProtocol":"code-oss","extensionAllowedProposedApi":["ms-vscode.vscode-js-profile-flame","ms-vscode.vscode-js-profile-table","ms-vscode.github-browser","ms-vscode.github-richnav"],"builtInExtensions":[{"name":"ms-vscode.node-debug","version":"1.44.17","repo":"https://github.com/microsoft/vscode-node-debug","metadata":{"id":"b6ded8fb-a0a0-4c1c-acbd-ab2a3bc995a6","publisherId":{"publisherId":"5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee","publisherName":"ms-vscode","displayName":"Microsoft","flags":"verified"},"publisherDisplayName":"Microsoft"}},{"name":"ms-vscode.node-debug2","version":"1.42.5","repo":"https://github.com/microsoft/vscode-node-debug2","metadata":{"id":"36d19e17-7569-4841-a001-947eb18602b2","publisherId":{"publisherId":"5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee","publisherName":"ms-vscode","displayName":"Microsoft","flags":"verified"},"publisherDisplayName":"Microsoft"}},{"name":"ms-vscode.references-view","version":"0.0.77","repo":"https://github.com/microsoft/vscode-reference-view","metadata":{"id":"dc489f46-520d-4556-ae85-1f9eab3c412d","publisherId":{"publisherId":"5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee","publisherName":"ms-vscode","displayName":"Microsoft","flags":"verified"},"publisherDisplayName":"Microsoft"}},{"name":"ms-vscode.js-debug-companion","version":"1.0.8","repo":"https://github.com/microsoft/vscode-js-debug-companion","metadata":{"id":"99cb0b7f-7354-4278-b8da-6cc79972169d","publisherId":{"publisherId":"5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee","publisherName":"ms-vscode","displayName":"Microsoft","flags":"verified"},"publisherDisplayName":"Microsoft"}},{"name":"ms-vscode.js-debug","version":"1.54.5","repo":"https://github.com/microsoft/vscode-js-debug","metadata":{"id":"25629058-ddac-4e17-abba-74678e126c5d","publisherId":{"publisherId":"5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee","publisherName":"ms-vscode","displayName":"Microsoft","flags":"verified"},"publisherDisplayName":"Microsoft"}},{"name":"ms-vscode.vscode-js-profile-table","version":"0.0.11","repo":"https://github.com/microsoft/vscode-js-profile-visualizer","metadata":{"id":"7e52b41b-71ad-457b-ab7e-0620f1fc4feb","publisherId":{"publisherId":"5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee","publisherName":"ms-vscode","displayName":"Microsoft","flags":"verified"},"publisherDisplayName":"Microsoft"}}],"webBuiltInExtensions":[{"name":"ms-vscode.github-browser","version":"0.0.15","repo":"https://github.com/microsoft/vscode-github-browser","metadata":{"id":"c1bcff4b-4ecb-466e-b8f6-b02788b5fb5a","publisherId":{"publisherId":"5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee","publisherName":"ms-vscode","displayName":"Microsoft","flags":"verified"},"publisherDisplayName":"Microsoft"}}],"//":"https://github.com/VSCodium/vscodium/pull/155/files","documentationUrl":"https://go.microsoft.com/fwlink/?LinkID=533484#vscode","keyboardShortcutsUrlMac":"https://go.microsoft.com/fwlink/?linkid=832143","keyboardShortcutsUrlLinux":"https://go.microsoft.com/fwlink/?linkid=832144","keyboardShortcutsUrlWin":"https://go.microsoft.com/fwlink/?linkid=832145","introductoryVideosUrl":"https://go.microsoft.com/fwlink/?linkid=832146","tipsAndTricksUrl":"https://go.microsoft.com/fwlink/?linkid=852118","newsletterSignupUrl":"https://www.research.net/r/vsc-newsletter","commit":"fe2dc2deb08e378069891b622bb62ad1d261d1b1","date":"2021-04-08T18:29:22Z","version":"1.54.2","extensionsGallery":{"serviceUrl":"https://extensions.coder.com/api","itemUrl":"","controlUrl":"","recommendationsUrl":""}},"nlsConfiguration":{"locale":"en","availableLanguages":{}},"commit":"fe2dc2deb08e378069891b622bb62ad1d261d1b1"}}}
[2021-04-22T01:31:48.604Z] debug vscode got message from code-server {"type":"socket"}
[2021-04-22T01:31:48.605Z] trace vscode code-server message content {"message":{"type":"socket","query":{"reconnectionToken":"afb44490-fdb1-4a01-841e-4cf391f7045a","reconnection":"false","skipWebSocketFrames":"false"},"permessageDeflate":true}}
[2021-04-22T01:31:48.611Z] trace vscode Protocol handshake {"token":"afb44490-fdb1-4a01-841e-4cf391f7045a"}
[2021-04-22T01:31:58.615Z] error vscode Handshake timed out {"token":"afb44490-fdb1-4a01-841e-4cf391f7045a"}

Here's the output with --log trace. (don't worry testpassword isn't the actual password of the instance)

Here's the browser log output:

serviceWorker.ts:4 [Service Worker] installed
serviceWorker.ts:9 [Service Worker] activated
code.snwy.me/:1 [Deprecation] ::-webkit-details-marker pseudo element selector is deprecated. Please use ::marker instead. See https://chromestatus.com/feature/6730096436051968 for more details.
vscode.js:6 debug got options
logger.ts:173 debug got options
register.ts:14 [Service Worker] registered
log.ts:272 TRACE [remote-connection][Management   ][afb44…][initial][code.snwy.me:80] 1/6. invoking socketFactory.connect().
code.snwy.me/:1 Site cannot be installed: Page does not work offline. Starting in Chrome 93, the installability criteria is changing, and this site will not be installable. See https://goo.gle/improved-pwa-offline-detection for more information.
browserSocketFactory.ts:162 WebSocket connection to 'wss://code.snwy.me/?reconnectionToken=afb44490-fdb1-4a01-841e-4cf391f7045a&reconnection=false&skipWebSocketFrames=false' failed: 
create @ browserSocketFactory.ts:162
log.ts:296   ERR [remote-connection][Management   ][afb44…][initial][code.snwy.me: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:272 TRACE Skipping initializing user data as settings sync is not enabled
log.ts:272 TRACE UserDataInitializationService#requiresInitialization
log.ts:272 TRACE lifecycle: phase changed (value: 2)
log.ts:278 DEBUG Checking for update...
webWorkerExtensionHost.ts:125 The web worker extension host is started without an iframe sandbox!
start @ webWorkerExtensionHost.ts:125
log.ts:272 TRACE workbench configuration {"webviewEndpoint":"https://code.snwy.me/webview","remoteAuthority":"code.snwy.me","logLevel":0,"workspaceProvider":{"payload":[["userDataPath","/home/mason/.local/share/code-server"],["enableProposedApi","[]"]],"trusted":true},"urlCallbackProvider":{"_store":{"_toDispose":{},"_isDisposed":false},"_onCallback":{"_disposed":false}},"credentialsProvider":{}}
log.ts:272 TRACE [remote-connection][ExtensionHost][16b32…][initial][code.snwy.me:80] 1/6. invoking socketFactory.connect().
log.ts:296   ERR WebSocket close with status code 1006: Error: WebSocket close with status code 1006
    at WebSocket.<anonymous> (https://code.snwy.me/static/fe2dc2deb08e378069891b622bb62ad1d261d1b1/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:631:108602)
errors.ts:27 Uncaught Error: WebSocket close with status code 1006

Error: WebSocket close with status code 1006
    at WebSocket.<anonymous> (browserSocketFactory.ts:129)
    at errors.ts:28
code.snwy.me/:1 Uncaught (in promise) SyntaxError: Unexpected token u in JSON at position 0
    at JSON.parse (<anonymous>)
    at Zt.getCachedViewContainerLocations (viewDescriptorService.ts:505)
    at new Zt (viewDescriptorService.ts:114)
    at C._createInstance (instantiationService.ts:110)
    at C._createServiceInstance (instantiationService.ts:230)
    at C._createServiceInstanceWithOwner (instantiationService.ts:219)
    at C._createAndCacheServiceInstance (instantiationService.ts:208)
    at C._safeCreateAndCacheServiceInstance (instantiationService.ts:151)
    at C._getOrCreateServiceInstance (instantiationService.ts:135)
    at Object.get (instantiationService.ts:54)
code.snwy.me/:1 Uncaught (in promise) SyntaxError: Unexpected token u in JSON at position 0
    at JSON.parse (<anonymous>)
    at Zt.getCachedViewContainerLocations (viewDescriptorService.ts:505)
    at new Zt (viewDescriptorService.ts:114)
    at C._createInstance (instantiationService.ts:110)
    at C._createServiceInstance (instantiationService.ts:230)
    at C._createServiceInstanceWithOwner (instantiationService.ts:219)
    at C._createAndCacheServiceInstance (instantiationService.ts:208)
    at C._safeCreateAndCacheServiceInstance (instantiationService.ts:151)
    at C._getOrCreateServiceInstance (instantiationService.ts:135)
    at Object.get (instantiationService.ts:54)
code.snwy.me/:1 Uncaught SyntaxError: Unexpected token u in JSON at position 0
    at JSON.parse (<anonymous>)
    at Zt.getCachedViewContainerLocations (viewDescriptorService.ts:505)
    at new Zt (viewDescriptorService.ts:114)
    at C._createInstance (instantiationService.ts:110)
    at C._createServiceInstance (instantiationService.ts:230)
    at C._createServiceInstanceWithOwner (instantiationService.ts:219)
    at C._createAndCacheServiceInstance (instantiationService.ts:208)
    at C._safeCreateAndCacheServiceInstance (instantiationService.ts:151)
    at C._getOrCreateServiceInstance (instantiationService.ts:135)
    at C._createInstance (instantiationService.ts:88)
extensionHostManager.ts:73 Error received from starting extension host
(anonymous) @ extensionHostManager.ts:73
extensionHostManager.ts:74 Error: WebSocket close with status code 1006
    at WebSocket.<anonymous> (browserSocketFactory.ts:129)
(anonymous) @ extensionHostManager.ts:74
log.ts:272 TRACE Error while resolving configuration file 'vscode-remote:/home/mason/.local/share/code-server/User/settings.json': Unable to read file 'vscode-remote:/home/mason/.local/share/code-server/User/settings.json' (Error: WebSocket close with status code 1006)
log.ts:296   ERR Unable to read file 'vscode-remote:/home/mason/.local/share/code-server/User/settings.json' (Error: WebSocket close with status code 1006): Error: Unable to read file 'vscode-remote:/home/mason/.local/share/code-server/User/settings.json' (Error: WebSocket close with status code 1006)
    at a.doReadAsFileStream (https://code.snwy.me/static/fe2dc2deb08e378069891b622bb62ad1d261d1b1/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:626:29460)
    at async a.readFile (https://code.snwy.me/static/fe2dc2deb08e378069891b622bb62ad1d261d1b1/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:626:28582)
    at async https://code.snwy.me/static/fe2dc2deb08e378069891b622bb62ad1d261d1b1/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:1233:5717
    at async Promise.all (index 0)
    at async Promise.all (index 0)
    at async b.loadConfiguration (https://code.snwy.me/static/fe2dc2deb08e378069891b622bb62ad1d261d1b1/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:1233:6373)
    at async d.reload (https://code.snwy.me/static/fe2dc2deb08e378069891b622bb62ad1d261d1b1/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:1233:4369)
    at async p.reloadLocalUserConfiguration (https://code.snwy.me/static/fe2dc2deb08e378069891b622bb62ad1d261d1b1/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:1999:32619)
log.ts:272 TRACE Error while resolving configuration file 'vscode-remote:/home/mason/.local/share/code-server/User/tasks.json': Unable to read file 'vscode-remote:/home/mason/.local/share/code-server/User/tasks.json' (Error: WebSocket close with status code 1006)
log.ts:296   ERR Unable to read file 'vscode-remote:/home/mason/.local/share/code-server/User/tasks.json' (Error: WebSocket close with status code 1006): Error: Unable to read file 'vscode-remote:/home/mason/.local/share/code-server/User/tasks.json' (Error: WebSocket close with status code 1006)
    at a.doReadAsFileStream (https://code.snwy.me/static/fe2dc2deb08e378069891b622bb62ad1d261d1b1/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:626:29460)
    at async a.readFile (https://code.snwy.me/static/fe2dc2deb08e378069891b622bb62ad1d261d1b1/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:626:28582)
    at async https://code.snwy.me/static/fe2dc2deb08e378069891b622bb62ad1d261d1b1/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:1233:5717
    at async Promise.all (index 0)
    at async Promise.all (index 1)
    at async b.loadConfiguration (https://code.snwy.me/static/fe2dc2deb08e378069891b622bb62ad1d261d1b1/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:1233:6373)
    at async d.reload (https://code.snwy.me/static/fe2dc2deb08e378069891b622bb62ad1d261d1b1/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:1233:4369)
    at async p.reloadLocalUserConfiguration (https://code.snwy.me/static/fe2dc2deb08e378069891b622bb62ad1d261d1b1/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:1999:32619)
log.ts:296   ERR WebSocket close with status code 1006: Error: WebSocket close with status code 1006
    at WebSocket.<anonymous> (https://code.snwy.me/static/fe2dc2deb08e378069891b622bb62ad1d261d1b1/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:631:108602)
log.ts:296   ERR WebSocket close with status code 1006: Error: WebSocket close with status code 1006
    at WebSocket.<anonymous> (https://code.snwy.me/static/fe2dc2deb08e378069891b622bb62ad1d261d1b1/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:631:108602)
browserSocketFactory.ts:162 WebSocket connection to 'wss://code.snwy.me/?reconnectionToken=16b32e15-d06b-498d-b846-1798b2fe2798&reconnection=false&skipWebSocketFrames=false' failed: 
create @ browserSocketFactory.ts:162
log.ts:296   ERR [remote-connection][ExtensionHost][16b32…][initial][code.snwy.me: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)
extensionHostManager.ts:73 Error received from starting extension host
(anonymous) @ extensionHostManager.ts:73
extensionHostManager.ts:74 Error: WebSocket close with status code 1006
    at WebSocket.<anonymous> (browserSocketFactory.ts:129)
(anonymous) @ extensionHostManager.ts:74
log.ts:272 TRACE web.main#windowResize
log.ts:272 TRACE Layout#layout, height: 757, width: 814
layout.ts:1218 Uncaught TypeError: Cannot read property 'layout' of undefined
    at O.layout (layout.ts:1218)
    at r.onWindowResize (window.ts:77)
    at window.ts:52
DevTools failed to load SourceMap: Could not load content for https://code.snwy.me/static/fe2dc2deb08e378069891b622bb62ad1d261d1b1/usr/lib/code-server/dist/pages/pages/vscode.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
code-asher commented 3 years ago

Ah OK this often happens because the reverse proxy isn't set up to proxy web sockets and so the socket connection fails. We might be able to pinpoint the issue if you can provide more details on the reverse proxy you're using and the configuration for it.

You could also try --link which will set up proxying for you through our cloud.

snoglobe commented 3 years ago

I'm using frp, and my configuration is here.

its-dibo commented 3 years ago

+1 -> v3.9.1

I think this issue occurs due to a network connection problem, because it only happens with a certain connection.

but the console log doesn't mention it.

hakanu commented 3 years ago

My problem is resolved with 3.9.3 on my raspberry pi over LAN (192.168.0.x address). Thanks.

luojiansh commented 3 years ago

v3.9.3

For me the timeout goes away when I open Chrome DevTools during every page reload.

TobiRoby commented 3 years ago

I suddenly experienced the time out issue in my setup two days ago. Here is how I solved it.

Setup:

Besides the timeouts I also noticed that initializing a ssh connection took up to 10 seconds. After a quick web search pointed me towards not optimal/ compatible network settings with VPN. So I set the MTU settings of my local network adapter to 1200. Not only is ssh blazing fast now, but all code-server timeouts vanished.

So the timeouts are related to the network and not code-server itself. But I still have no clue, why my setup stopped working from one day to the other...

facundomedica commented 3 years ago

I got this error randomly and in the console I see: {"error":"ENOENT: no such file or directory, open '/usr/lib/code-server/dist/pages/pages/vscode.js.map'"} Note the double "/pages/pages". Version 3.9.3. It also happened with 3.11.0 but it's like solving itself randomly? I'm using the --link flag. It solves itself randomly eventually 🤪

jsjoeio commented 3 years ago

That is very unusual. Thanks for the note @facundomedica!

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no activity occurs in the next 5 days.

pyIronManCoder commented 1 year ago

I suddenly experienced the time out issue in my setup two days ago. Here is how I solved it.

Setup:

  • local: wsl ubuntu 20.04
  • remote: code-server (3.9.3) in docker on ubuntu 18.04-LTS running in azure
  • network VPN GlobalProtect

Besides the timeouts I also noticed that initializing a ssh connection took up to 10 seconds. After a quick web search pointed me towards not optimal/ compatible network settings with VPN. So I set the MTU settings of my local network adapter to 1200. Not only is ssh blazing fast now, but all code-server timeouts vanished.

So the timeouts are related to the network and not code-server itself. But I still have no clue, why my setup stopped working from one day to the other...

Hello, could you please specify what error you recieved, I am getting "[2023-05-03T07:39:06.690Z] error timed out" when I run "code-server" command. I am running it on a local Raspberry Pi 0 W (Installed via "yarn global add code-server" command and it was a successful install). I check my MTU on my router it shows 1500. I tried on 3 wifi networks (different Access Points) still shows same error.