GitHub Codespaces Creation Failed
Quick answer
A failed codespace is never usable: delete it and create a new one. Check githubstatus.com first, and make sure the container build finishes in under an hour with no interactive prompts.
Most likely fix: Check status and retry
How to fix it
Try these in order — the most common fix is first.
1. Check status and retry
- Check githubstatus.com for active Codespaces incidents
- Delete the failed codespace from github.com/codespaces
- Create a new codespace
Did this fix it?2. Find a stuck build
- On the "Setting up your codespace" page click "View logs" (or click "Building codespace" in VS Code desktop)
- Look for a step that is hanging or asking for input
- Remove interactive prompts from build scripts
Did this fix it?3. Speed up slow builds
- Configure prebuilds for the repository so the container is built ahead of time
Did this fix it?
Symptoms
Creating a codespace fails, or the "Setting up your codespace" page never finishes.
Why it happens
- Temporary cloud infrastructure problem, such as failing to provision the virtual machine
- Container build takes longer than one hour and is cancelled
- A build script waits for interactive user input
This guide also covers
- codespace creation failed
- codespaces stuck on setting up your codespace
- github codespaces not working
Still not working?
If GitHub Codespaces keeps failing, you're not alone. See every GitHub Codespaces problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usThe same problem in other apps
Other GitHub Codespaces errors
- Codespace Running in Recovery Mode: "This codespace is currently running in recovery mode due to a container error"
- Can't Create a Codespace: No Option to Create on the Repository
- GitHub Codespaces "503 Service Unavailable" Error
- Codespaces "Oh no, it looks like you are offline" and Other Connection Errors
- GitHub Codespaces Port Forwarding Not Working
- Codespace Out of Storage: How to Free Disk Space
- Codespaces Included Usage Used Up: Core Hours and Storage Quota
- Codespaces Prebuild Not Working: "Prebuild Ready" Label Missing