codesandbox / codesandbox/codesandbox-client

GitHub Devbox sandboxes fail after successful instance bootstrap (Initial connect to Pitcher, editor 502, preview 503)

Open
#8,883 0 comments 1 reaction 0 assignees View on GitHub

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/instance returns 200
  • the response includes valid-looking bootstrap metadata:
    • bootupType: "CLEAN"
    • pitcherURL
    • token / cluster information
  • the browser still fails during:
    • Initial connect to Pitcher
    • Unable to start the microVM
    • State: 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:

  1. Open GitHub-backed Devbox sandboxes from documentation links.
  2. Reach a working editor + preview to validate examples.

To Reproduce

  1. Open a GitHub-backed Devbox URL (examples below).
  2. Observe that the session does not reach a usable editor/preview state.
  3. For repro 6mqzwx, inspect DevTools / Network:
    • POST https://codesandbox.io/api/beta/sandboxes/branches/6mqzwx/instance
    • response 200
    • bootupType: "CLEAN"
    • valid-looking pitcherURL
  4. Observe the UI still reporting:
    • Initial connect to Pitcher
    • Unable to start the microVM
    • State: ERROR
  5. Open the direct preview URL and observe 503 snapshot-related failures.

Fresh repro (strongest case study)

Import URL

https://codesandbox.io/p/devbox/github/reneemundie/instantsearch/tree/debug/codesandbox-fresh/examples/react/ssr

Result:

  • 502
  • Error: 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

https://6mqzwx-8080.csb.app

Result:

  • 503
  • vm is not snapshotted or hibernated

Non-Algolia controls (also fail)

Algolia doc-linked examples (also fail)

Network / lifecycle notes (from HAR + DevTools)

For sandbox 6mqzwx (behavior varies slightly between attempts):

  • GET https://codesandbox.io/api/v1/sandboxes/6mqzwx can succeed.
  • POST https://codesandbox.io/api/beta/sandboxes/branches/6mqzwx/instance can return 200 with:
    • 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 microVM
  • Initial connect to Pitcher
  • State: 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.