codesandbox / codesandbox/codesandbox-client
GitHub Devbox sandboxes fail after successful instance bootstrap (Initial connect to Pitcher, editor 502, preview 503)
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 13.6k
- Forks
- 2.4k
- Avg merge
- 6d 19h
- Merged PRs (30d)
- 2
Description
🐛 bug report
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for an issue that matches the one I want to file, without success.
Description of the problem
Opening GitHub-backed Devbox sandboxes frequently fails to produce a usable editor + preview, even when the sandbox bootstrap API appears to succeed.
In the clearest repro (6mqzwx):
POST /api/beta/sandboxes/branches/6mqzwx/instancereturns200- the response includes valid-looking bootstrap metadata:
bootupType: "CLEAN"pitcherURL- token / cluster information
- the browser still fails during:
Initial connect to PitcherUnable to start the microVMState: ERROR
- the editor shell may return
502 - the preview may return
503
This suggests the failure occurs after instance bootstrap—likely during Pitcher connectivity, microVM bring-up, or downstream editor/preview lifecycle handling—rather than the instance API itself simply returning an error.
Separately, the editor HTML shell routes sometimes return 502 Bad Gateway responses (Google-style “temporary server error” pages). That can happen even when specific API calls return 200 in DevTools, since those are different requests/layers.
Direct preview can fail with 503, including CodeSandbox error messaging such as:
- “We were not able to resume the VM, because there is no snapshot available.”
vm is not snapshotted or hibernated
I reproduced similar failures using both Algolia and non-Algolia repos, which makes this feel broader than a single third-party repository issue.
During testing, CodeSandbox also intermittently displayed a service disruption / API issues banner. That may correlate with some of the instability, though the core failure mode still reproduces outside obvious outage windows.
Expected behavior
A successful instance bootstrap should result in:
- a reachable editor shell
- successful Pitcher connectivity
- a healthy microVM/editor session
- a working preview endpoint
How has this issue affected you? What are you trying to accomplish?
We rely on CodeSandbox links in public documentation so developers can quickly try integrations and examples.
Currently, multiple documentation-linked examples fail for our team, which blocks:
- validating examples after merges
- demos
- developer onboarding/testing flows
I am trying to:
- Open GitHub-backed Devbox sandboxes from documentation links.
- Reach a working editor + preview to validate examples.
To Reproduce
- Open a GitHub-backed Devbox URL (examples below).
- Observe that the session does not reach a usable editor/preview state.
- For repro
6mqzwx, inspect DevTools / Network:POST https://codesandbox.io/api/beta/sandboxes/branches/6mqzwx/instance- response
200 bootupType: "CLEAN"- valid-looking
pitcherURL
- Observe the UI still reporting:
Initial connect to PitcherUnable to start the microVMState: ERROR
- Open the direct preview URL and observe
503snapshot-related failures.
Fresh repro (strongest case study)
Import URL
Result:
502Error: Server Error. The server encountered a temporary error and could not complete your request. Please try again in 30 seconds.
Direct sandbox
https://codesandbox.io/p/sandbox/6mqzwx
Result:
502
Direct preview
Result:
503vm is not snapshotted or hibernated
Non-Algolia controls (also fail)
- https://codesandbox.io/p/devbox/github/SafdarJamal/vite-template-react
- https://codesandbox.io/p/devbox/github/vitejs/vite/tree/main/packages/create-vite/template-react
Algolia doc-linked examples (also fail)
- https://codesandbox.io/p/sandbox/github/algolia/autocomplete/tree/next/examples/instantsearch
- https://codesandbox.io/p/sandbox/github/algolia/autocomplete/tree/next/examples/react-instantsearch
- https://codesandbox.io/p/sandbox/github/algolia/autocomplete/tree/next/examples/vue-instantsearch
- https://codesandbox.io/p/sandbox/github/algolia/instantsearch/tree/master/examples/react/ssr
- https://codesandbox.io/p/sandbox/github/algolia/doc-code-samples/tree/master/react-instantsearch/remix
Network / lifecycle notes (from HAR + DevTools)
For sandbox 6mqzwx (behavior varies slightly between attempts):
GET https://codesandbox.io/api/v1/sandboxes/6mqzwxcan succeed.POST https://codesandbox.io/api/beta/sandboxes/branches/6mqzwx/instancecan return200with:bootupType: "CLEAN"- valid-looking
pitcherURL - token fields
- websocket attempts occur against:
wss://ctrl.fc-us-3.codesandbox.io/6mqzwx/?token=...
- some telemetry captures report:
Pitcher initialized
Despite the above, the editor UI can still fail with:
Unable to start the microVMInitial connect to PitcherState: ERROR
while preview remains unavailable (503 on *.csb.app).
Earlier sessions also showed intermittent 502 responses from /api/beta/sandboxes/branches/.../instance and other Pitcher-related failures similar to #8074.
Link to sandbox
https://codesandbox.io/p/sandbox/6mqzwx
Your Environment
| Software | Name/Version |
|---|---|
| CodeSandbox | production (PUBLIC_VERSION observed in page: main-4971117) |
| Browser | Chrome (recent stable) |
| Operating System | macOS |
Additional notes
I can provide:
- HAR exports
- screenshots
- timestamps
- screen recordings
if additional diagnostics would help.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the POST /api/beta/sandboxes/branches/{id}/instance request, the Pitcher websocket connection, and the editor and preview responses described in the HAR and DevTools notes. Compare successful bootstrap metadata with the later microVM and snapshot failures. Done means the editor shell is reachable, Pitcher connects, the microVM reaches a healthy session, and the preview works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend, cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100