403 and 401 error trying to open github codespaces #199884
-
🏷️ Discussion TypeBug BodyI am getting the following error in VS Code Codespaces extension, either when trying to open codespace from VS Code, or clicking the option to open repository in VS Code from github.com. No helpful warnings/errors or information on how to resolve the issue. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
Hi, Based on the logs, authentication appears to succeed initially ("Successfully signed in"), but subsequent Codespaces API requests are returning 401 Unauthorized and 403 Forbidden responses. A few things I would check:
Sometimes the VS Code authentication token becomes stale even though the extension reports a successful sign-in.
In VS Code:
If it works in the browser but not in VS Code, the issue is likely related to local authentication or the extension.
The logs show: GitHub Codespaces version 1.18.13 so confirming you're on the latest extension version may help.
The combination of:
suggests either a token permission issue, account access issue, or an extension-side authentication problem rather than a problem with the Codespace itself. Could you confirm:
That would help narrow down the cause. |
Beta Was this translation helpful? Give feedback.
-
|
yes sign out github account then re sign in fixed it |
Beta Was this translation helpful? Give feedback.
-
|
This error usually points to an authentication or client version mismatch between the VS Code Codespaces extension and GitHub’s API. The 401/403 responses mean the extension isn’t able to fetch your codespaces list even though you’re signed in. Steps you can try:
In short: update the extension, re‑authenticate, and escalate with correlation IDs if the issue continues. |
Beta Was this translation helpful? Give feedback.
Hi,
Based on the logs, authentication appears to succeed initially ("Successfully signed in"), but subsequent Codespaces API requests are returning 401 Unauthorized and 403 Forbidden responses.
A few things I would check:
Sometimes the VS Code authentication token becomes stale even though the extension reports a successful sign-in.
In VS Code:
Verify that the account signed into VS Code is the same account that owns or has access to the Codespace.
Check whether the Codespace can be opened successfully from the GitHub web in…