Repository navigation
[Bug] Failed to start VM: Sandbox not found #206
Description
Activity
21st-connector commented
on Apr 29, 2026 ContributorMore actions🤖 Automation triggered: Implement ISSUE
I'm starting to work on this automatically.
Powered by 1Code
21st-connector commented
on Apr 29, 2026 ContributorMore actions🤖 Automation triggered: Analyze Github Issue
I'm starting to work on this automatically.
Powered by 1Code
21st-connector commented
on Apr 29, 2026 ContributorMore actionsIssue Triage
Summary
This error ("Failed to start VM: Sandbox not found") originates from the server-side E2B sandbox infrastructure, not from the desktop app itself. The desktop app connects to cloud-hosted E2B virtual machines for "sandbox mode" chats, and this error indicates the backend failed to provision or locate a sandbox VM during account setup.
Codebase Context
The app has two chat modes (
src/renderer/lib/atoms/index.ts:879-887):- Local mode — worktree-based chats stored in local SQLite
- Sandbox mode — cloud-based E2B sandboxes, accessed via URLs like
https://3003-{sandboxId}.e2b.app
Sandbox interactions are handled through backend API endpoints:
src/renderer/lib/remote-api.ts— remote chat/sandbox API client (getSandboxDiff,getSandboxFile, export endpoints)src/main/lib/git/sandbox-import.ts— sandbox state import/export logicsrc/renderer/features/agents/main/active-chat.tsx— sandbox setup status tracking (sandboxSetupStatus,sandboxSetupError)
The error strings "Failed to start VM" and "Sandbox not found" do not appear anywhere in the desktop app source code, confirming this is a server-side error message being surfaced to the user.
Subscription & Auth Flow
The signup flow uses billing methods defined in
src/renderer/features/onboarding/billing-method-page.tsx:32-75, with "Claude Pro/Max" (claude-subscription) as the recommended option. User plan data is fetched from the backend viasrc/main/auth-manager.ts:259-278(/api/desktop/user/plan).Related Issues
- Build from source, failed to fork sandbox #31 (closed) — "Build from source, failed to fork sandbox" — different root cause (corrupted
node-ptybinaries from postinstall script), not related - [CRITICAL] Sandbox disabled in browser window configuration #103 (closed) — "Sandbox disabled in browser window configuration" — about Electron's renderer sandbox security setting, unrelated to E2B VM sandboxes
No previous issues match this specific server-side VM provisioning error.
Likely Cause
This appears to be a backend/infrastructure issue rather than a desktop app bug. Possible causes:
- E2B sandbox provisioning failure — the backend couldn't spin up a VM during account setup
- Transient server-side error — the sandbox was created but became unavailable before the client could connect
- Account/subscription state mismatch — the signup process may not have fully completed before a sandbox was requested
Suggested Next Steps
- Retry signup — if this was a transient infrastructure issue, retrying may resolve it
- Check if the account was created — try signing in again; the subscription may have been activated despite the error
- Clear app data and retry — on macOS:
rm -rf ~/Library/Application\ Support/Agents\ Dev/(for dev) or~/Library/Application\ Support/1Code/(for production), then relaunch - Server-side investigation needed — the 1Code team should check E2B sandbox provisioning logs for sandbox ID
8lfjd8to determine why it wasn't found
This issue likely needs attention from the backend/infrastructure team since the error originates server-side.
21st-connector commented
on Apr 29, 2026 ContributorMore actionsIssue Analysis
Thanks for reporting this. Here's what I found after reviewing the codebase:
What's happening
The "Failed to start VM: Sandbox not found" error originates from the server-side sandbox provisioning, not from the desktop app itself. During the Claude Code Max signup/authentication flow, the app calls the backend endpoint
/api/auth/claude-code/startwhich creates a cloud sandbox (running on E2B infrastructure) for your session (src/main/lib/trpc/routers/claude-code.ts:174-195).The error message (
Failed to start VM 8lfjd8: Sandbox not found) indicates the server attempted to start a VM with ID8lfjd8but the sandbox resource could not be located — this is a server-side/infrastructure issue, not a client-side bug.Relevant code path
- User initiates sign-up →
startAuthmutation fires (claude-code.ts:178) - Desktop app sends
POSTto{apiUrl}/api/auth/claude-code/startwith the desktop token - Server creates a sandbox and returns
{ sandboxId, sandboxUrl, sessionId } - If sandbox creation fails, the error propagates back to the desktop UI
Not a duplicate
The two previously closed sandbox-related issues are unrelated:
- [CRITICAL] Sandbox disabled in browser window configuration #103 — Electron's
sandbox: falseconfig (security hardening, not VM provisioning) - Build from source, failed to fork sandbox #31 — Build-from-source
postinstallscript issue withelectron-rebuild
Possible causes
- Transient infrastructure issue: The E2B sandbox backend may have been temporarily unavailable or the specific VM template was not found
- Account provisioning timing: If the Claude Code Max subscription was just initiated, the sandbox quota/allocation may not have been fully provisioned yet
- Region/availability: Sandbox availability may vary by region
Suggested workarounds
- Retry: Close and reopen the app, then try the sign-up flow again — the sandbox provisioning may have been a transient failure
- Check subscription status: Verify that the Claude Code Max subscription completed successfully on the billing side before retrying
- Clear app state (if retries fail):
# macOS rm -rf ~/Library/Application\ Support/Agents\ Dev/ # Then restart the app
For maintainers
This likely needs investigation on the server/infrastructure side (the
/api/auth/claude-code/startendpoint and E2B sandbox provisioning). The desktop app is correctly surfacing the error from the backend — no client-side code change would resolve this.- User initiates sign-up →
21st-connector commented
on Apr 29, 2026 ContributorMore actionsIssue Analysis
What's happening
The error "Failed to start VM: Sandbox not found" originates from the server-side sandbox creation during the Claude Code OAuth flow. When you select "Claude Code Max" as your billing method during onboarding, the app calls the 21st.dev backend (
/api/auth/claude-code/start) to spin up a temporary CodeSandbox VM that handles the Anthropic OAuth exchange. The error indicates that the server-side sandbox (VM8lfjd8) either failed to provision or was not found by the orchestration layer.Relevant code path
- Onboarding UI triggers
startAuthmutation on mount —src/renderer/features/onboarding/anthropic-onboarding-page.tsx:92 - tRPC router calls the 21st.dev API to create the sandbox —
src/main/lib/trpc/routers/claude-code.ts:174-196 - If the API returns a non-2xx response, the error is thrown at
claude-code.ts:188and surfaced in the UI via theonErrorcallback atanthropic-onboarding-page.tsx:101-106
The actual sandbox provisioning happens on the 21st.dev server, not in the desktop app. The desktop app simply forwards the request and displays the result.
Root cause
This is a server-side infrastructure issue, not a client-side bug. The "Sandbox not found" error suggests one of:
- The CodeSandbox/E2B VM provisioning service returned an error or was temporarily unavailable
- The sandbox
8lfjd8was created but terminated or became unreachable before the client could poll it - A transient infrastructure issue on the 21st.dev backend
Not a duplicate
Previously closed sandbox-related issues (#103 and #31) are unrelated:
- [CRITICAL] Sandbox disabled in browser window configuration #103 was about Electron's renderer sandbox (
webPreferences.sandbox: false) — a security config, not VM provisioning - Build from source, failed to fork sandbox #31 was about
electron-rebuildcorruptingnode-ptybinaries during build from source
Suggested workaround
- Retry — Click the "Connect" button again or restart the onboarding flow. The sandbox provisioning is often transient.
- Use API key instead — Go back to the billing method selection and choose "API Key" to bypass the sandbox-based OAuth flow entirely. You can use an Anthropic API key from console.anthropic.com.
For maintainers
Some improvements that could help with this class of errors:
- Better error messaging: The raw "Failed to start VM: Sandbox not found" is opaque to users. The
startAutherror path atclaude-code.ts:188could surface a more actionable message (e.g., "Authentication service temporarily unavailable, please retry"). - Automatic retry with backoff: The
startAuthmutation in the onboarding page fires once on mount. Adding retry logic (e.g., 2-3 attempts with exponential backoff) before showing an error would improve resilience. - Server-side investigation: Check the 21st.dev backend logs for sandbox
8lfjd8to determine why it was not found — provisioning failure, timeout, or infrastructure issue.
🤖 Generated with Claude Code
- Onboarding UI triggers
#Retry: Close and reopen the app, then try the sign-up flow again — the sandbox provisioning may have been a transient failure
Check subscription status: Verify that the Claude Code Max subscription completed successfully on the billing side before retrying
Clear app state (if retries fail):macOS
rm -rf ~/Library/Application\ Support/Agents\ Dev/
Then restart the app
Tried this. Keeps failing. Active Claude Code subscription. Claude Code with Max subscription works in terminal.
This is a new 1Code user account.

When trying to sign up for my Claude Code Max subscription I receive the following error: Failed to start VM 8lfjd8: Sandbox not found
I am using macOS 26.4.1