code-server: Blank page: error vscode Handshake timed out

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

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 44 (15 by maintainers)

Most upvoted comments

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.

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…

No, I’m using x64, on Ubuntu

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.

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?

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 🤪

v3.9.3

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

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

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

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.

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"}

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

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.

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

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

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.

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.