Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blank page: error vscode Handshake timed out #3027

Closed
hakanu opened this issue Apr 4, 2021 · 44 comments
Closed

Blank page: error vscode Handshake timed out #3027

hakanu opened this issue Apr 4, 2021 · 44 comments
Milestone

Comments

@hakanu
Copy link

hakanu commented Apr 4, 2021

OS/Web Information

  • Web Browser: Google Chrome Version 89.0.4389.114 (Official Build) (64-bit)
  • Local OS: Ubuntu 21.04
  • Remote OS: Raspbian GNU/Linux 10 (buster)
  • Remote Architecture: armv7l GNU/Linux
  • code-server --version:3 .9.2

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": "..."}
  1. It was working fine before the upgrade.
  2. 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
Copy link
Contributor

jsjoeio commented Apr 5, 2021

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:

@jsjoeio jsjoeio added needs-investigation This issue needs to be further investigated waiting-for-info Waiting for more information from submitter labels Apr 5, 2021
@hakanu
Copy link
Author

hakanu commented Apr 5, 2021

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

@jsjoeio
Copy link
Contributor

jsjoeio commented Apr 5, 2021

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

@hakanu
Copy link
Author

hakanu commented Apr 5, 2021

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
Copy link
Contributor

jsjoeio commented Apr 5, 2021

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
Copy link
Author

hakanu commented Apr 6, 2021

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
Copy link

Same with install in Google Cloud Shell.

@jsjoeio
Copy link
Contributor

jsjoeio commented Apr 6, 2021

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
Copy link

jkcoxson commented Apr 7, 2021

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
Copy link

jkcoxson commented Apr 7, 2021

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

@jsjoeio
Copy link
Contributor

jsjoeio commented Apr 7, 2021

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.

  • Remote OS: Raspbian GNU/Linux 10 (buster)
  • Remote Architecture: armv7l GNU/Linux

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
Copy link

jkcoxson commented Apr 7, 2021

No, I'm using x64, on Ubuntu

@jkcoxson
Copy link

jkcoxson commented Apr 7, 2021

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
Copy link
Contributor

jsjoeio commented Apr 8, 2021

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
Copy link

jkcoxson commented Apr 8, 2021

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
Copy link
Contributor

jsjoeio commented Apr 8, 2021

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
Copy link

@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
Copy link

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
Copy link
Contributor

jsjoeio commented Apr 12, 2021

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.

@jsjoeio jsjoeio removed the waiting-for-info Waiting for more information from submitter label Apr 12, 2021
@jsjoeio jsjoeio added this to the v3.9.4 milestone Apr 12, 2021
@danyhoron
Copy link

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
Copy link
Contributor

jsjoeio commented Apr 15, 2021

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
Copy link

danyhoron commented Apr 16, 2021

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
Copy link

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
Copy link
Contributor

jsjoeio commented Apr 16, 2021

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 🙌

@jsjoeio
Copy link
Contributor

jsjoeio commented Apr 19, 2021

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
Copy link
Member

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
Copy link

snoglobe commented Apr 22, 2021

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
Copy link

snoglobe commented Apr 22, 2021

[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
Copy link
Member

code-asher commented Apr 22, 2021

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
Copy link

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

@code-asher code-asher self-assigned this Apr 26, 2021
@its-dibo
Copy link

its-dibo commented Apr 30, 2021

+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
Copy link
Author

hakanu commented May 1, 2021

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

@luojiansh
Copy link

v3.9.3

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

@code-asher code-asher modified the milestones: v3.10.0, v3.10.1 May 7, 2021
@code-asher code-asher modified the milestones: v3.10.1, 3.11.0 May 17, 2021
@jsjoeio jsjoeio modified the milestones: 3.10.2, 3.11.0 May 21, 2021
@TobiRoby
Copy link

TobiRoby commented Jul 8, 2021

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...

@jsjoeio jsjoeio modified the milestones: 3.11.0, 3.12.0 Jul 19, 2021
@facundomedica
Copy link

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
Copy link
Contributor

jsjoeio commented Aug 4, 2021

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

@code-asher code-asher removed their assignment Aug 12, 2021
@code-asher code-asher modified the milestones: 3.12.0, On Deck Aug 12, 2021
@stale
Copy link

stale bot commented Feb 8, 2022

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.

@stale stale bot added the stale label Feb 8, 2022
@stale stale bot closed this as completed Feb 13, 2022
@pyIronManCoder
Copy link

pyIronManCoder commented May 4, 2023

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.

@code-asher code-asher removed the needs-investigation This issue needs to be further investigated label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests