Skip to content

Fix missing sandbox.start() call in middleware#315

Closed
04cb wants to merge 1 commit intocloudflare:mainfrom
04cb:fix/sandbox-start-missing
Closed

Fix missing sandbox.start() call in middleware#315
04cb wants to merge 1 commit intocloudflare:mainfrom
04cb:fix/sandbox-start-missing

Conversation

@04cb
Copy link

@04cb 04cb commented Mar 7, 2026

Fixes #291.

The sandbox middleware was getting a sandbox instance but never calling sandbox.start() before setting it in the Hono context. This caused containerFetch and wsConnect to fail with 'container is not running' errors on every request.

Fixed by adding await sandbox.start() before setting the sandbox in context. The start() method is idempotent (no-op if already running) so calling it on every request is safe.

The sandbox middleware was getting a sandbox instance but never calling
sandbox.start() before setting it in the Hono context. This caused
containerFetch and wsConnect to fail with 'container is not running'
errors.

Fixed by adding await sandbox.start() before setting the sandbox in
context. The start() method is idempotent and safe to call on every
request.
@04cb 04cb closed this by deleting the head repository Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Container not started before containerFetch: missing sandbox.start() call

1 participant