Coder.comC
Coder.comโ€ข2y agoโ€ข
33 replies
coder_pie

code-server stopped loading after upgrading coder to 2.8.1

Previous version: 2.7.2
code-server version: 4.20.1 : This is as same before the upgrade
I use this to start code-server: code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
When I open the coder resource I get 502 error- Failed to proxy request to application: proxyconnect tcp: dial context: connect tcp [fd7a:115c:a1e0:481e:b8c0:a53:c24:11b4]:8080: connection was refused

If I remove the --port param and use the default 8080 then it loads fine.

I read through the release notes and cannot figure out what I am missing. Appreciate any pointers! TIA
Solution
I've stumbled upon this as well and I think I found the solution.

We're using Microsoft VSCode (not code-server by Coder) - currently Visual Studio Code 1.87.0

The VSCode web button stopped working:
2024-04-22 16:08:52.629 [debu]  net.tailnet.net.netstack: netstack: could not connect to local server at 127.0.0.1:8000: dial tcp 127.0.0.1:8000: connect: connection refused

not sure when this started happening but I was updating Coder and noticed the web IDE was no longer opening. I'm sure it was some VSCode update.

This is the command we were running:
code-server serve-local --accept-server-license-terms --without-connection-token &>/tmp/code-server.log 2>&1 &

I checked the ports exposed inside the container using sudo netstat -tulp and found that VSCode was binding to ::1 which is the localhost for IPv6. As mentioned before, at the agent log above, Coder tries to use 127.0.0.1, which is localhost for IPv4.

The solution is telling code-server to bind to specific interface/ip like so:
code-server serve-local --accept-server-license-terms --without-connection-token --host 127.0.0.1 &>/tmp/code-server.log 2>&1 &

And now it should be working as before ๐Ÿ™‚


p.s. I'm not entirely sure why localhost in .tf file resolves to 127.0.0.1 via Coder
Was this page helpful?