Open XVII opened 9 months ago
I've come across this as well, several times. A workaround that I use is to just use a new browser tab to access the ProxyCommand / CF Access protected hostname, approve, then it works after that in VS Code.
I'm trying to isolate if it's a VS Code quirk or maybe something OpenSSH? After updating to OpenSSH 9.6 seems ok?
Not sure. Will continue testing.
I think it is OpenSSH version. I just was using 8.6 that's included with Windows and it had the issue. Moving to 9.5+ has resolved this. My original logs were adapted from a newer version so don't include v8.6.
The internal one isn't updated as often as the one provided via WinGet.
Seeing this on OS X too on OpenSSH 9.7... Browser doesn't appear to change behaviour -- Chrome, Edge, and Safari tested. The browser pages sometimes launch minutes after it was meant to (and VS Code has long timed out).
Changing this parameter stops VS Code from timing out so quickly before cloudflared as established the connection:
This issue continues!
Incidentally running cloudflared.exe access tcp
with the same params seems to "unblock" it. Unsure if ssh
is just an alias of tcp
(the help isn't different) but it suddenly starts working again.
Describe the bug
When using VS Code to Remote SSH to a server behind Cloudflared, I sometimes get an extra ordinarily long delay between initiating the remote tunnel and then the Access approval page being popped in the default browser. Sometimes, this delay is so long, it happens minutes (i.e 15 minutes) after the connection was initiated, long after VS Code has failed.
The failure message is "The operation timed out." because the tunnel never gets established.
Obviously there's a lot of variables/components in the chain, but I've added the debug/trace output below if that reveals anything.
I've turned on Trace for the OpenSSH component and the Cloudflared log-level, however haven't found anything conclusive. It's like ProxyCommand is not sending any sort of packets which means Cloudflared doesn't trigger the browser? It also seems like a cascading failure in that subsequent attempts will also fail while the first is attempting to connect?
Unsure what else to gather in this scenario to help diagnosis.
To Reproduce
Remote SSH using ProxyCommand as per Cloudflared documentation.
If it's an issue with Cloudflare Tunnel:
Expected behavior
No delay in popping Access approval page.
Environment and versions
Occurs on both MacOS and Windows. Multiple versions up to 2024.1.1.
Logs and errors
VS Code:
Cloudflared:
Additional context
Setting a ConnectTimeout=500 doesn't really do much except sometimes allow the unusual delay to finish though it's often longer than this up to 15 minutes.