How to change tunnel location and can't access locally

Hi, I just installed coder via the CLI and have two problems. 1. It always defaults to "US East Pittsburgh", which gives me a high latency, as I am in Germany. 2. I can't access it via IP:PORT, but don't know why. Yes the IP and port are correct and I am in the same network, but it just doesn't work.
16 Replies
Codercord
Codercord5d ago
Codercord
Codercord5d ago
<#1371064755615305828>
Category
Help needed
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Pyenb
PyenbOP5d ago
May 11 09:45:48 remote-dev01 systemd[1]: Starting coder.service - "Coder - Self-hosted developer workspaces on your infra"...
May 11 09:45:48 remote-dev01 coder[1040]: Started HTTP listener at http://127.0.0.1:3000
May 11 09:45:48 remote-dev01 coder[1040]: Using built-in PostgreSQL (/home/coder/.config/coderv2/postgres)
May 11 09:45:52 remote-dev01 coder[1040]: Opening tunnel so workspaces can connect to your deployment. For production scenarios, specify an external access URL
May 11 09:45:52 remote-dev01 coder[1040]: Error picking closest dev tunnel: socket: permission denied
May 11 09:45:52 remote-dev01 coder[1040]: Defaulting to US East Pittsburgh
May 11 09:45:52 remote-dev01 coder[1040]: Using tunnel in US East Pittsburgh with latency 0s.
May 11 09:45:53 remote-dev01 coder[1040]: ╔═══════════════════════════════════════════════╗
May 11 09:45:53 remote-dev01 coder[1040]: ║ View the Web UI: ║
May 11 09:45:53 remote-dev01 coder[1040]: ║ https://xxx.pit-1.try.coder.app ║
May 11 09:45:53 remote-dev01 coder[1040]: ╚═══════════════════════════════════════════════╝
May 11 09:45:58 remote-dev01 coder[1040]: ==> Logs will stream in below (press ctrl+c to gracefully exit):
May 11 09:45:48 remote-dev01 systemd[1]: Starting coder.service - "Coder - Self-hosted developer workspaces on your infra"...
May 11 09:45:48 remote-dev01 coder[1040]: Started HTTP listener at http://127.0.0.1:3000
May 11 09:45:48 remote-dev01 coder[1040]: Using built-in PostgreSQL (/home/coder/.config/coderv2/postgres)
May 11 09:45:52 remote-dev01 coder[1040]: Opening tunnel so workspaces can connect to your deployment. For production scenarios, specify an external access URL
May 11 09:45:52 remote-dev01 coder[1040]: Error picking closest dev tunnel: socket: permission denied
May 11 09:45:52 remote-dev01 coder[1040]: Defaulting to US East Pittsburgh
May 11 09:45:52 remote-dev01 coder[1040]: Using tunnel in US East Pittsburgh with latency 0s.
May 11 09:45:53 remote-dev01 coder[1040]: ╔═══════════════════════════════════════════════╗
May 11 09:45:53 remote-dev01 coder[1040]: ║ View the Web UI: ║
May 11 09:45:53 remote-dev01 coder[1040]: ║ https://xxx.pit-1.try.coder.app ║
May 11 09:45:53 remote-dev01 coder[1040]: ╚═══════════════════════════════════════════════╝
May 11 09:45:58 remote-dev01 coder[1040]: ==> Logs will stream in below (press ctrl+c to gracefully exit):
And as said, accessing http://192.168.178.170:3000/, just doesn't return anything.
2: enp6s18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether bc:24:11:70:3f:20 brd ff:ff:ff:ff:ff:ff
inet 192.168.178.170/24 brd 192.168.178.255 scope global enp6s18
valid_lft forever preferred_lft forever
inet6 2a02:8109:a298:de00:be24:11ff:fe70:3f20/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 86395sec preferred_lft 86395sec
inet6 fe80::be24:11ff:fe70:3f20/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
2: enp6s18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether bc:24:11:70:3f:20 brd ff:ff:ff:ff:ff:ff
inet 192.168.178.170/24 brd 192.168.178.255 scope global enp6s18
valid_lft forever preferred_lft forever
inet6 2a02:8109:a298:de00:be24:11ff:fe70:3f20/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 86395sec preferred_lft 86395sec
inet6 fe80::be24:11ff:fe70:3f20/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
ben@remote-dev01:~$ sudo netstat -tunlp | grep coder
tcp 0 0 127.0.0.1:3000 0.0.0.0:* LISTEN 1281/coder
udp 0 0 0.0.0.0:57455 0.0.0.0:* 1281/coder
udp 0 0 0.0.0.0:54060 0.0.0.0:* 1281/coder
udp6 0 0 :::36256 :::* 1281/coder
udp6 0 0 :::54060 :::* 1281/coder
ben@remote-dev01:~$ sudo netstat -tunlp | grep coder
tcp 0 0 127.0.0.1:3000 0.0.0.0:* LISTEN 1281/coder
udp 0 0 0.0.0.0:57455 0.0.0.0:* 1281/coder
udp 0 0 0.0.0.0:54060 0.0.0.0:* 1281/coder
udp6 0 0 :::36256 :::* 1281/coder
udp6 0 0 :::54060 :::* 1281/coder
Phorcys
Phorcys5d ago
hell, you need to host it on your own domain to get rid of the Coder tunnel in Pittsburg try.coder.app is in the US but it's only meant for testing purposes
Pyenb
PyenbOP5d ago
But shouldn't I still be able to access it locally? I just went with the quick start guide Where it also shows it being accessed locally after the same steps I did
Phorcys
Phorcys5d ago
yeah but when you have the try.coder.app tunnel enabled it won't start one locally
Pyenb
PyenbOP4d ago
Ah okay thanks, but could I also just disable tunnels entirely? Also even with a custom URL and a CF Tunnel I still can't access it locally or remote
Phorcys
Phorcys4d ago
you can, but you don't want to what I'm referring to as the 'Coder tunnel' is the try.coder.app proxy, and that is disabled by defining an access URL could you share a bit more details? (screenshots, logs, etc)
Pyenb
PyenbOP4d ago
Sure thing. Just to be sure I started with a fresh VM and installed nothing besides coder. Then added the domain entry to CF Tunnels. But even still, I cannot reach the site locally either
No description
No description
No description
Pyenb
PyenbOP4d ago
ip a entry stayed the same https://discord.com/channels/747933592273027093/1371064755615305828/1371065228191858799 Anything else you need? Also tried changing the HTTP listener address to 0.0.0.0:3000 and 192.168.178.170:3000, but same result Now it's all default except the access url Also no ufw or any other special stuff running Just tried doing a curl 127.0.0.1:3000 from the VM itself and that returned something. So it's really just somethingh about me not being able to access it from any other device
Pyenb
PyenbOP4d ago
No description
Pyenb
PyenbOP4d ago
I am lost. I just tried the exact same thing again: coder server --access-url=https://code.pyenb.network/ --http-address=192.168.178.170:3000 and now it just works?? I will take that. Thanks for the help anyways nvm. It's still not working via Domain. I can access it locally now, but the domain stays blank: https://code.pyenb.network/ It sometimes works, but then throws a 404 in the next second Could be DNS tho imma see
Pyenb
PyenbOP4d ago
Problems seems to persist. Healthchecks keep failing. If I refresh the websocket one, it keeps switching between 101 and 404
No description
ÙwÚ
ÙwÚ2d ago
what's your config? @Pyenb ok I see what happen there, should use a coder.env to run it locally for consistent env var I have a script like this:
main@ser3lx:~/startup$ cat coder_server.sh
export $(grep -v '^#' /etc/coder.d/coder.env | xargs)
coder server --dangerous-allow-path-app-site-owner-access
main@ser3lx:~/startup$ cat coder_server.sh
export $(grep -v '^#' /etc/coder.d/coder.env | xargs)
coder server --dangerous-allow-path-app-site-owner-access
main@ser3lx:~/startup$ cat /etc/coder.d/coder.env
CODER_ADDRESS=0.0.0.0:7778
CODER_PG_CONNECTION_URL=
CODER_TLS_CERT_FILE=/home/main/ssl/generate-ip-cert/cert.pem
CODER_TLS_ENABLE=false
CODER_TLS_KEY_FILE=/home/main/ssl/generate-ip-cert/key.pem
CODER_HTTP_ADDRESS=0.0.0.0:7777
main@ser3lx:~/startup$ cat /etc/coder.d/coder.env
CODER_ADDRESS=0.0.0.0:7778
CODER_PG_CONNECTION_URL=
CODER_TLS_CERT_FILE=/home/main/ssl/generate-ip-cert/cert.pem
CODER_TLS_ENABLE=false
CODER_TLS_KEY_FILE=/home/main/ssl/generate-ip-cert/key.pem
CODER_HTTP_ADDRESS=0.0.0.0:7777
I used to run it like this (now I run coder behind reverse proxy in container) when you specify access_url I think you have to specify key/cert files as well ( correct me if im wrong), but run without tls enable is totally possible. You just drop tls_enable=false, and coder will ignore coder_http_address i think then point your CF tunnel to http localhost:7778 works with coder in the past, I havent playing around with coder without tls enable for awhile so I'm not sure if it worked without tls enable coder prone to break if CF decide to timeout I suggest grab cert/key files and enable tls
ÙwÚ
ÙwÚ2d ago
if you don't know how to use reverse proxy/letencrypt/certbot then just use ssl cert/key generated by cloudflare (assuming you have your domain registered to cloudflare?):
No description
Pyenb
PyenbOP2d ago
Yeah, just was testing around. Ran it via systemd otherwise That was the idea, as CF should do the automatic TLS stuff okok, thanks Not registered, but I use it for DNS

Did you find this page helpful?