Installed Coder, but can't connect to code-server with VSCode

I just recently installed Coder with the docker-compose.yaml file, it's running on an EC2 instance, in a private subnet that I connect with the Cloudflare ZTNA VPN. I can connect to it, create a template and start a workspace, the problem is, when I try to connect to Coder with VSCode, it tries for a long time then I get this error: OpenSSH_9.9p1, OpenSSL 3.3.2 3 Sep 2024 Connection closed by UNKNOWN port 65535 local-server-1> ssh child died, shutting down [19:54:15.318] WARN: $PLATFORM is undefined in installation script output. Errors may be dropped. [19:54:15.319] Failed to parse remote port from server output [19:54:15.324] Resolver error: Error: ...
Solution:
Hey, in the end I had to put it into a public subnet AND remove all that I was allowing into my SG, then it worked
Jump to solution
8 Replies
Codercord
Codercord2mo ago
<#1349399391278207028>
Category
Help needed
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Igor Zimmer
Igor ZimmerOP2mo ago
My docker-compose.yaml, for reference:
version: "3.9"
services:
coder:
image: ghcr.io/coder/coder:${var.coder_version}
ports:
- "80:7080"
environment:
CODER_PG_CONNECTION_URL: "postgresql://${var.pg_user}:${var.pg_password}@database/${var.pg_db}?sslmode=disable"
CODER_HTTP_ADDRESS: "0.0.0.0:7080"
CODER_ACCESS_URL: "http://coder.DOMAIN"
group_add:
- $GID
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- coder_home:/home/coder
depends_on:
database:
condition: service_healthy
database:
image: "postgres:16"
ports:
- "5432:5432"
environment:
POSTGRES_USER: ${var.pg_user}
POSTGRES_PASSWORD: ${var.pg_password}
POSTGRES_DB: ${var.pg_db}
volumes:
- coder_data:/var/lib/postgresql/data
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U ${var.pg_user} -d ${var.pg_db}",
]
interval: 5s
timeout: 5s
retries: 5
volumes:
coder_data:
coder_home:
version: "3.9"
services:
coder:
image: ghcr.io/coder/coder:${var.coder_version}
ports:
- "80:7080"
environment:
CODER_PG_CONNECTION_URL: "postgresql://${var.pg_user}:${var.pg_password}@database/${var.pg_db}?sslmode=disable"
CODER_HTTP_ADDRESS: "0.0.0.0:7080"
CODER_ACCESS_URL: "http://coder.DOMAIN"
group_add:
- $GID
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- coder_home:/home/coder
depends_on:
database:
condition: service_healthy
database:
image: "postgres:16"
ports:
- "5432:5432"
environment:
POSTGRES_USER: ${var.pg_user}
POSTGRES_PASSWORD: ${var.pg_password}
POSTGRES_DB: ${var.pg_db}
volumes:
- coder_data:/var/lib/postgresql/data
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U ${var.pg_user} -d ${var.pg_db}",
]
interval: 5s
timeout: 5s
retries: 5
volumes:
coder_data:
coder_home:
Phorcys
Phorcys2mo ago
does coder ssh work?
Igor Zimmer
Igor ZimmerOP2mo ago
I just saw what is causing the problem, but couldn't find a solution yet... When I created the same template I'm using, but on PUBLIC subnet, it works, I can connect to code-server and VSCode desktop. But when I created it in a PRIVATE subnet (even with 0.0.0.0/0 and all traffic inbound from my VPN security group), I suddendly couldn't connect to VSCode Desktop, I get the same Connection closed by UNKNOWN port 65535 errror from before
Phorcys
Phorcys2mo ago
hey, this sounds like firewalling issues, but i'm not really sure how to help you with that were you able to solve it?
Solution
Igor Zimmer
Igor Zimmer2mo ago
Hey, in the end I had to put it into a public subnet AND remove all that I was allowing into my SG, then it worked
Phorcys
Phorcys2mo ago
nice
Codercord
Codercord2mo ago
@Phorcys closed the thread.

Did you find this page helpful?