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.

I am running also into this problem in case you need more data. In my case the problem appears after leaving vscode idle for some hours and try to reconnect to my codespace. It then disappears if I close and reopen vscode.

@eltriplet - Thanks for sharing that here! I’ve relayed that to our Codespaces Engineers as a part of their investigation.

Hi there! I’m also experiencing this issue. Reloading the page appears not to have any effect, but it seems like signing in and out of github resolves the issue (I left the codespace open and did not restart it (if that affects anything)).