coder / code-server

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

Code-server is starting but cannot be opened in browser (endless loading) #289

Closed mfmayer closed 5 years ago

mfmayer commented 5 years ago

Description

After starting the code-server it's not reachable via browser (endless loading). Last output from code-server: INFO Starting shared process [1/5]...

Steps to Reproduce

  1. extract code-server-1.32.0-282-linux-x64.tar.gz
  2. cd into folder
  3. Run ./codes-server
  4. Open browser: https://localhost:8443
kylecarbs commented 5 years ago

Might be something strange occurring because of the VM. Do you have the netstat command available?

EvgeniyMakhmudov commented 5 years ago

I have similar situation. Ubuntu linux, the latest code-server-1.32.0-310-linux-x64.tar.gz Starting looks correct

INFO  Additional documentation: http://github.com/codercom/code-server
INFO  Initializing {"data-dir":"/root/.local/share/code-server","working-dir":"/root/Projects/test","log-dir":"/root/.cache/code-server/logs/20190319200527399"}
INFO  Starting shared process [1/5]...
INFO  Starting webserver... {"host":"0.0.0.0","port":8443}
WARN  No certificate specified. This could be insecure.
WARN  Documentation on securing your setup: https://coder.com/docs
INFO   
INFO  Password: c3f830fe4349151b2b4ac984
INFO   
INFO  Started (click the link below to open):
INFO  http://localhost:8443/
INFO   

From lsof command i see that port is used code-serv 2736 root 12u IPv4 21487 0t0 TCP *:8443 (LISTEN)

But request of / have no response

SpencerPark commented 5 years ago

To add another data point, I run into this issue on WSL with ubuntu 16.04. The netstat version output is listed below in case the version is an issue? From #11 it looks like working on WSL is possible and from discussion in #153 (and @kylecarbs comment above), an appropriate net-tools (specifically netstat?) seemed to fix it but I would like to narrow down what versions work if that is the problem.

$ netstat --version
net-tools 2.10-alpha
Fred Baumgarten, Alan Cox, Bernd Eckenfels, Phil Blundell, Tuan Hoang, Brian Micek and others
+NEW_ADDRT +RTF_IRTT +RTF_REJECT +FW_MASQUERADE +I18N +SELINUX
AF: (inet) +UNIX +INET +INET6 +IPX +AX25 +NETROM +X25 +ATALK +ECONET +ROSE -BLUETOOTH
HW:  +ETHER +ARC +SLIP +PPP +TUNNEL -TR +AX25 +NETROM +X25 +FR +ROSE +ASH +SIT +FDDI +HIPPI +HDLC/LAPB +EUI64
sr229 commented 5 years ago

@SpencerPark it depends on what the node-netstat dependency relies at.

jmccl commented 5 years ago

Same thing happening to me on Manjaro. (No VM)

dcrouch79 commented 5 years ago

I get the same problem when running the binary on a Digital Ocean droplet following the Deploy on DigitalOcean docs. Running the dockerized version, however, on the same droplet works OK though.

Inspecting the lsof output from both gives...

dockerized version (can connect):

docker-pr 11706            root    4u  IPv6 211024      0t0  TCP *:8443 (LISTEN)

binary version (can't connect):

code-serv 12073            root   22u  IPv4 214297      0t0  TCP *:8443 (LISTEN)

It seems IPv6 works but IPv4 doesn't.

This is strange though because IPv6 is actually disabled on the droplet (default setting). Out of curiosity, I tried enabling IPv6 but it made no difference. There's no firewall setup on the server that I can see either.

dcrouch79 commented 5 years ago

For me, it turns out the Linux firewall was enabled and blocking the port. Nothing to do with IPv4 vs IPv6!

sudo ufw status will show whether Linux firewall is enabled or not.

I think the firewall was installed for me because I chose the Ubuntu + Docker base image for the droplet instead of the default Ubuntu image. Docker handles the firewall automatically.

code-asher commented 5 years ago

Gonna close this since v2's web server has been completely rewritten, netstat is no longer a dependency, and the shared process no longer exists.