Coder code-server port forwarding issue.

For some reason when I am forwading my development ports coder seems to inject some code into the dom that is causing some issues when I am trying to view my react development environment. I was lurking around to see if anyone else has had any issues similar but I don't see anything similar. I am using the docker deployed version of coder that is behind a reverse proxy. I my health checks are returning back ok access url, database, derp, provisioner, websockets, and workspace proxy. Not sure if there is something I have misconfigured. Another thing is I can't get the coder port-forward workspace --tcp 8000:8080 command to return the port. Is this a docker runtime limitation since the only port exposed is default from the container? My understanding is that everything is being routed through the main 'outside' url via HTTPS. Thanks for checking this post out.
9 Replies
Codercord
Codercord5mo ago
Codercord
Codercord5mo ago
<#1379579767816327168>
Category
Help needed
Product
code-server
Platform
Linux
Logs
Please post any relevant logs/error messages.
zounce
zounce5mo ago
coder seems to inject some code into the dom that is causing some issues when I am trying to view my react
This sounds very unusual - what behaviour are you seeing?
Another thing is I can't get the [command] to return the port.
I'm not sure what you mean by return - does localhost:8080 not work?
fmtech_
fmtech_OP5mo ago
I recreated my workspace and got the coder banner to go away on the served html but I still am missing a chunk of my React app. Essentially the main react component. I hope its just the way the app links files, the same thing happens for my python template files when they are being served. The other issue with the port forwading seems to only work when I'm at my local network so I believe xx.xx.xx.xx:7080 works for the ssh port forwarding since I was able to use my local vs-code session to work and render my react app. I guess since I am behind a reverse proxy my configuration may have some issues. Any tips for the first? I don't mind not having my local environment if I can code on the go with a coder-server session but not being able to preview from live dev environments is tricky. Not sure if the CODER HTTP ADDRESS should be the same as the access url. Last time I chaged it it broke my coder docker instance. environment: CODER_PG_CONNECTION_URL: "postgresql://${POSTGRES_USER:-username}:${POSTGRES_PASSWORD:-password}@database/${POSTGRES_DB:-coder}?sslmode=disable" CODER_HTTP_ADDRESS: "0.0.0.0:7080" CODER_ACCESS_URL: "HTTPS:://PROXY.CONTOSO.COM" CODER_OAUTH2_GITHUB_ALLOW_SIGNUPS: true
zounce
zounce5mo ago
I recreated my workspace and got the coder banner to go away on the served html b
I've not heard of a Coder banner being injected into any webservers running in a workspace, do you happen to have a screenshot? AFAIK we deliberately don't touch whatever's being served from a workspace. You might be running into a cors issue or a js bundle location issue? I'm assuming you're accessing your app from <app>--<agent>--<workspace>--<username>--apps.wsproxy.coder.example (whereas localhost might work fine) I don't suppose there's anything insightful in the dev console?
Is this a docker runtime limitation since the only port exposed is default from the container? My understanding is that everything is being routed through the main 'outside' url via HTTPS.
Also, the answer to this is no. Regardless of what ports you have exposed from the container, coder port-forward will make the ports specified available locally using coder's networking
fmtech_
fmtech_OP4mo ago
I was able to access my cli port forwading from my local network but not when outside using this method. For some reason whenever I don't use my own access url the port forwarding works from vs code-server. With the provided default proxy by coder. when I change it to my coder.example.com url it breaks. All the other functions seem to work. This is when I get when I use my access url of coder-server preview: Failed to load resource: the server responded with a status of 500 () I rebuilt my containers a few times trying to iron this out. Everything seems to check out. Unless I need to add a wildcard domain entry for my workspace like *.coder.example.com?
No description
No description
zounce
zounce4mo ago
Everything seems to check out. Unless I need to add a wildcard domain entry for my workspace like *.coder.example.com?
You do need a wildcard access URL set for port-forwarding via the browser: i.e. for this menu to even appear:
No description
zounce
zounce4mo ago
but you don't need it for CLI port-forwarding
I was able to access my cli port forwading from my local network but not when outside using this method.
Could you describe the steps you're performing to use CLI port-forwarding?
Phorcys
Phorcys4mo ago
another thing i'd like to ask is, are you using a reverese-proxy in front of Coder? and if yes, could you share the config?

Did you find this page helpful?