code-server: Unable to connect with --link

  • Web Browser: Safari
  • Local OS: iPadOS 14.3
  • Remote OS: Ubuntu 20.04
  • Remote Architecture: x86_64
  • code-server --version: 3.9.0 fc6d123da59a4e5a675ac8e080f66e032ba01a1b

When running code-server --link, the process starts successfully however when you go to the link given in the server output, the error Error connecting to your code-server instance shows up when you go to the site.

Initially, no error gets thrown in the terminal however after around 1 hour, [2021-02-16T09:59:22.641Z] info 2021/02/16 09:59:22 [ERR] yamux: Failed to read header: failed to get reader: failed to read frame header: EOF [2021-02-16T09:59:22.645Z] info 2021-02-16 09:59:22.644 [WARN] <proxy.go:48> code-server proxy exited {"error": "accept tcp [::]:36221: use of closed network connection"} is logged.

Thanks, Sam.

About this issue

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

Most upvoted comments

Apologies. We’re a small team (code-server). I’ll ping them again and see if I can get any update.

Worst case: they come back and say we won’t be able to fix it.

Best case: they say they can and I can share more information.

Other scenario: if I could collect data and say, “this is affecting X number of users in the code-server community and we should prioritize” then that might help.

Give this message a 👍 if you’re experiencing this issue still.

It looks like the link project has been shelved, possibly indefinitely. I am not sure how far the rewrite got but it seems not far enough before the plug was pulled.

I think the only thing we can recommend now is to set up a domain and a reverse proxy, possibly Caddy since it handles certificates for you or with some of the other methods listed here: https://github.com/coder/code-server/blob/main/docs/guide.md#setup-guide

Okay I got a response.

I spoke to the developer. We’re working on some networking changes in the enterprise product going from WebSockets to WebRTC. Eventually those changes will make their way into coder-cloud (powers --link + code-server) in which case, will solve this issue. I don’t have an ETA but will share updates on this thread as I have them

UAE, VPN server was set to London, UK

Well, it’s not an iPad issue specifically, i’ve had the same issue on different machines. I’ve tried it on a PC, mac and my iPad. The only steps that I took was to startup code server with the --link flag, nothing else, no config or anything.

I have the same problem

  • brand new AWS instance
  • AWS free tier
  • Ubuntu 20.04
  • Installed with code-server with this (from https://github.com/cdr/code-server): curl -fsSL https://code-server.dev/install.sh | sh
  • Opened HTTP, HTTPS, Custom TCP (pot 8080), and SSH in inbound rules
  • Started code-server with: code-server --link
  • …and then opened Safari on my mac and entered the https-address shown
  • …and then get: ‘Error connecting to your code-server instance’

Any ideas?

⚠️ This issue has been marked wontfix and will be closed in 2 days.

Went from Italy to Portugal, it worked in Italy but now it doesn’t work here in Lisbon. I’m running it off the Frankfurt region in GCP. Restarting or rebooting don’t solve the issue.

This is nice there is a good chain here. Learning how to github / programming because of you guys… so thanks for having a great product and am looking forward to the correction.

It appears for me that it times out, if I haven’t done anything in the system I feel like cdr.co just terminates the connection. (It’s free so, hey… i get it.) But these are the similar errors I am getting.

As the project develops more will --link be intergrated? I’d be willing to pay some monies to get it running. I love being able to go to a webpage and keep coding.

That’s great news! Good to finally see some progress on this issue.

Thanks a lot for your efforts and hopefully we can have this issue resolved in the near future.

On Tue, Jul 20, 2021 at 9:58 PM Joe Previte @.***> wrote:

Okay I got a response.

I spoke to the developer. We’re working on some networking changes in the enterprise product going from WebSockets to WebRTC. Eventually those changes will make their way into coder-cloud (powers --link + code-server) in which case, will solve this issue. I don’t have an ETA but will share updates on this thread as I have them

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cdr/code-server/issues/2734#issuecomment-883547929, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADLUVGZZ3D23NEQNHCOQ2FLTYWTJVANCNFSM4XW2NRYQ .

Been more then a month now, still no update?

Unfortunately, no updates. I reached out to the developer but haven’t heard back yet.

Hi @SamHep0803! So I spoke to the developer working on this. He had another priority come up and wasn’t able to finish it last week. It’s in progress but I don’t have an ETA on when it will be done. Feel free to ping this issue again in two weeks!

I managed to finally get it working by running a server on Oracle Cloud in Germany using the —link option. I am accessing the server from Denmark. Not sure if Germany and Denmark are in the same ‘region’. I did not have to use VPN but of course set up the server side to accept traffic on the relevant ports.

Hi all.

I finally found some time to investigate this. I was able to semi-reproduce this.

Reproduction Steps

  1. Download VPN for macOS: TunnelBear
  2. Run code-server --link
  3. Enable VPN using Cyprus (the country)
  4. Open code-server using link (i.e. https://<you-link>.cdr.co/) in browser

Expected

It loads code-server in the browser

Actual

It doesn’t or it shows this screen:

image

Screenshots

https://user-images.githubusercontent.com/3806031/113611312-300a9400-9603-11eb-9403-cac0a2f71242.mov

Logs

➜  ~ code-server --link
[2021-04-05T18:30:32.198Z] info  code-server 3.9.2 109d2ce3247869eaeab67aa7e5423503ec9eb859
[2021-04-05T18:30:32.198Z] info  Using user-data-dir ~/.local/share/code-server
[2021-04-05T18:30:32.209Z] info  Using config file ~/.config/code-server/config.yaml
[2021-04-05T18:30:32.209Z] info  HTTP server listening on http://127.0.0.1:54718 (randomized by --link)
[2021-04-05T18:30:32.209Z] info    - Authentication is disabled (disabled by --link)
[2021-04-05T18:30:32.209Z] info    - Not serving HTTPS (disabled by --link)
[2021-04-05T18:30:32.654Z] info  Proxying code-server to Coder Cloud, you can access your IDE at https://joes_mbp-jsjoeio.cdr.co
[2021-04-05T18:31:04.179Z] info  2021/04/05 11:31:04 [ERR] yamux: Failed to read header: failed to get reader: failed to read frame header: read tcp 192.168.86.108:54723->104.26.1.18:443: read: no route to host
[2021-04-05T18:31:04.180Z] info  Connection to Coder-Cloud disrupted, re-establishing connection: proxy code-server: accept stream: failed to get reader: failed to read frame header: read tcp 192.168.86.108:54723->104.26.1.18:443: read: no route to host
[2021-04-05T18:31:04.180Z] info  2021-04-05 18:31:04.179 [WARN]	<proxy.go:48>	code-server proxy exited	{"error": "accept tcp [::]:54722: use of closed network connection"}

Workaround

…use a VPN and set the region to the region of where your server is currently located

Per @SamHep0803’s comment, this works for me as well.

Next Steps

I’ll follow up with the developer who created this and see if they know how to fix this.

We could spin it up on GCP and see what happens. If a VPN fixes it maybe it’s related to location somehow.

The only reproduction steps I can give is starting code-server with the --link flag, that’s all, no other changes were made. It’s not specific to host machine, I’ve tried it on both GCP and DigitalOcean, not guest specific, tried on different platforms and OS’s. I have a feeling it’s an issue with cdr’s servers and not with code-server