e2b-dev / e2b-dev/runtime

Sandbox creation fails with generic error when template files are in archived storage class

Open
#3,137 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
1.6k
Forks
438
PR merge metrics
No merged PRs in 30d

Description

Bug Description

When S3/S3-compatible object storage lifecycle rules transition template build files to archived storage classes (e.g. GLACIER, ARCHIVE_FR, COLD_ARCHIVE), attempting to create a sandbox from those templates fails with a generic Internal gRPC error instead of a clear, actionable message.

Root Cause

The AWS storage provider in packages/shared/pkg/storage/storage_aws.go only handles NoSuchKey errors from GetObject/HeadObject calls, mapping them to ErrObjectNotExist. However, when objects are archived, S3-compatible backends return an InvalidObjectState error instead, which falls through to the generic error path.

The orchestrator (packages/orchestrator/pkg/server/sandboxes.go) only checks for ErrObjectNotExist to return a FailedPrecondition status. The unhandled InvalidObjectState results in a codes.Internal error with the message "failed to create sandbox", giving users no indication that the issue is related to archived storage.

Expected Behavior

When sandbox files are archived, the system should return a clear FailedPrecondition error like:
sandbox files for '' are archived and not directly accessible, please rebuild the template

Affected Code Paths

  • awsObject.WriteTo() - blob reads
  • awsObject.OpenRangeReader() - range reads for block devices
  • awsObject.Size() - object metadata queries
  • Server.Create() - sandbox creation error handling

Environment

This affects deployments using S3-compatible storage backends (e.g. Volcengine TOS, AWS S3, MinIO) with lifecycle rules that transition objects to archived storage classes.

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

Read packages/shared/pkg/storage/storage_aws.go and trace awsObject.WriteTo(), OpenRangeReader(), and Size(), then follow the error handling in packages/orchestrator/pkg/server/sandboxes.go Server.Create(). Verify archived-object failures produce the stated FailedPrecondition message instead of the generic Internal error across the affected code paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, go
Domain
backend, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.