Tencent/WeKnora · error

invalid script

Error message

invalid script

What it means

waitUntilRunning polls ContainerInspect until the container reaches Running state. A nil State in any poll response aborts the wait with this dockerError-wrapped error, because the loop cannot classify the container without a status. Reached from Create, Connect, and ensureRunning.

Source

Thrown at internal/sandbox/sandbox.go:103

	// client goes silent for longer than this value.
	DefaultCubeSandboxTTL = 30 * time.Minute
	// DefaultCubeHTTPTimeout bounds a single HTTP call to the CubeAPI
	// (excluding user script execution which has its own per-call timeout).
	DefaultCubeHTTPTimeout = 30 * time.Second

	// DefaultE2BSandboxTTL matches the E2B SDK's built-in default so an
	// unset E2BSandboxTTL still yields a valid sandbox lifetime.
	DefaultE2BSandboxTTL = 5 * time.Minute
	// DefaultE2BHTTPTimeout bounds a single HTTP call to the E2B API.
	DefaultE2BHTTPTimeout = 30 * time.Second
)

// Common errors
var (
	ErrSandboxDisabled   = errors.New("sandbox is disabled")
	ErrTimeout           = errors.New("execution timed out")
	ErrScriptNotFound    = errors.New("script not found")
	ErrInvalidScript     = errors.New("invalid script")
	ErrExecutionFailed   = errors.New("script execution failed")
	ErrSecurityViolation = errors.New("security validation failed")
	ErrDangerousCommand  = errors.New("script contains dangerous command")
	ErrArgInjection      = errors.New("argument injection detected")
	ErrStdinInjection    = errors.New("stdin injection detected")
)

// Sandbox defines the interface for isolated script execution
type Sandbox interface {
	// Execute runs a script in an isolated environment
	Execute(ctx context.Context, config *ExecuteConfig) (*ExecuteResult, error)

	// Cleanup releases sandbox resources
	Cleanup(ctx context.Context) error

	// Type returns the sandbox type
	Type() SandboxType

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Retry the operation — the next poll may see a complete inspect result
  2. Fix mock/stub ContainerInspect responses in tests to include State
  3. Verify Docker daemon health and version; re-inspect the container manually (docker inspect <id>) to confirm state data
  4. Re-create the sandbox if the container record is persistently inconsistent
Defensive patterns

Strategy: validation

When it happens

Trigger: Calling Create or Connect on a Docker sandbox where a ContainerInspect poll iteration returns a container with nil State; also hit inside ensureRunning's wait loop.

Common situations: Same as Connect's variant: mock APIs missing State in tests, daemon races immediately after container create, or a daemon returning malformed inspect data.

Related errors


AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02). Data as JSON: /api/errors/b7174f654f194501. Report an issue: GitHub.