Codespace fails to connect: 502

I have been seeing intermittent failures when opening a GitHub workspace in VS Code. The error message says that the server returned a 502 status (but nothing more, that I see). Right now it is not returning an error (at least, as quickly as it was), but it is also apparently stalled indefinitely before it opens any content or starts a terminal, with green spinner that simply says “Opening Remote…”

The full error message is:

Failed to connect to the remote extension host server (Error: Codespace token exchange request failed with status 502)

It would be delightful if there were some self-service way to see more information about this failure. It would, of course, be even more delightful if this weren’t happening, but we all know that failures are inevitable, so I’d settle for more visibility into the inevitable failure.

@larvacea - Thanks for sharing this report with us! We’ve raised this with our engineering team working on Codespaces so they can investigate this further. They’re aware of this issue and its intermittent nature.

If this occurs again in a public repository, could you please share the full name with owner and also any relevant request-response headers that you might see in your browser’s developer console with us? We can forward that over to the team as well as a part of their investigation.