Coder in VSCode sometimes stuck on embedded relay and not switching to peer-to-peer

This is a follow up from https://discord.com/channels/747933592273027093/971231372373033030/1236740492172071127 To sum it up again: Some days my VSCode almost immediately switches to peer-to-peer, others it's stuck on the coder embedded relay all day long. My network doesn't change, my firewall settings don't change, my coder server doesn't change. As for vscode extension version I'm not aware if there's a connection as that updates automatically in the background, but since it's been an on-off thing and not a one time "oh it broke" situation I'd assume it has nothing to do with the extension either. Not unlikely that some external factors like my ISP having a bad day are the cause of this, but I have no idea how I would approach debugging this.
11 Replies
Codercord
Codercord5mo ago
<#1236768152285614182>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
maanex
maanex4mo ago
it asked me which platform i host coder on, that's linux, but my vscode and personal os is windows (unfortunately) any ideas?
Cian
Cian4mo ago
A good starting point would be to read https://coder.com/docs/v2/latest/networking/stun and figure out what networking scenario applies to you. From what you've described so far, it sounds like you could be behind a 'hard NAT'.
STUN and NAT - Coder v2 Docs
Learn how Coder establishes direct connections
Cian
Cian4mo ago
But the TL;DR is that in order to set up a direct connection, both the Coder server and the Coder CLI need to know each others' public IP address and port on which they can communicate directly. The "Deployment Health > DERP" page can also show some useful information related to the above.
maanex
maanex4mo ago
Thank you, will take a look when i find time!
Cian
Cian4mo ago
Just remembered -- you might want to check that UDP traffic in the high port range is possible between your personal OS and the server hosting your Coder instance. so check firewalls etc. on both client and server
Phorcys
Phorcys3mo ago
hey @maanex, any luck?
maanex
maanex3mo ago
Hi @Phorcys, thanks for asking! Unfortunately not, no. I've digged through the windows defender and firewall settings and granted all coder.exe entries full access to any network resources I could but that didn't do anything. After some hesitation I also disabled the cloudflare proxy and let my domain expose the coder deployment's real ip, so my client should know that now. And in fact the average embedded relay ping was lowered drastically to a point where I'm fine working with the relay now. But there's still bad days and most of the time it still does does not switch to p2p. So technically not resolved but currently in a state where I personally would no longer need help.
Phorcys
Phorcys3mo ago
alright
Phorcys
Phorcys3mo ago
it would be nice if you could open an issue over at coder/coder on GH so the Coder team can take a look
GitHub
GitHub - coder/coder: Provision remote development environments via...
Provision remote development environments via Terraform - coder/coder
Phorcys
Phorcys3mo ago
they are more active on GitHub
Want results from more Discord servers?
Add your server