{"record":{"id":"40b7078a94547103","repo":"Tencent/WeKnora","slug":"remote-sandbox-create-w","errorCode":null,"errorMessage":"remote sandbox: create: %w","messagePattern":"remote sandbox: create: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sandbox/remote_sandbox.go","lineNumber":90,"sourceCode":"// sandbox down. It is the ephemeral path used when a caller provides no\n// SessionID.\nfunc (s *RemoteSandbox) Execute(ctx context.Context, cfg *ExecuteConfig) (*ExecuteResult, error) {\n\tif s == nil || s.client == nil {\n\t\treturn nil, ErrSandboxDisabled\n\t}\n\tif cfg == nil {\n\t\treturn nil, ErrInvalidScript\n\t}\n\tif s.createRequest.TemplateID == \"\" {\n\t\treturn nil, errors.New(\"sandbox: remote sandbox has no template configured\")\n\t}\n\n\texecCtx, cancel := boundedExecuteContext(ctx, cfg)\n\tdefer cancel()\n\n\thandle, err := s.client.Create(execCtx, s.createRequest)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"remote sandbox: create: %w\", err)\n\t}\n\tdefer s.disposeEphemeral(ctx, handle)\n\n\treturn s.ExecuteOnHandle(execCtx, handle, cfg)\n}\n\n// ExecuteOnHandle runs cfg's script against an existing handle without\n// allocating or deleting the underlying sandbox. It is the persistent path\n// SessionBoundManager drives after resolving the session's handle.\nfunc (s *RemoteSandbox) ExecuteOnHandle(\n\tctx context.Context,\n\thandle RemoteSandboxHandle,\n\tcfg *ExecuteConfig,\n) (*ExecuteResult, error) {\n\tif s == nil || s.client == nil {\n\t\treturn nil, ErrSandboxDisabled\n\t}\n\tif handle == nil {","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/sandbox/remote_sandbox.go#L72-L108","documentation":"RemoteSandbox.Execute creates an ephemeral remote sandbox via client.Create before running the command. If creation fails the error is wrapped as \"remote sandbox: create\" and the ephemeral execution aborts. It indicates the remote sandbox backend rejected or could not complete the create request.","triggerScenarios":"Calling Execute on a remote sandbox when the provider Create RPC fails: quota exhausted, invalid image/config, auth token expired, or backend capacity errors.","commonSituations":"Cloud sandbox quota limits during CI bursts; expired API credentials; requesting an image or resource size the provider doesn't offer; provider outage.","solutions":["Read the wrapped cause to identify provider-specific failure and address it (quota, image, auth)","Retry Execute with backoff for transient capacity errors","Validate the sandbox config (image, resources) against provider limits before creating","Refresh provider credentials before long-running jobs"],"exampleFix":"// before\nout, err := sbx.Execute(ctx, cfg)\nif err != nil { return err }\n// after\nout, err := sbx.Execute(ctx, cfg)\nif err != nil {\n    if strings.Contains(err.Error(), \"remote sandbox: create\") && isTransient(err) {\n        return retryWithBackoff(ctx, cfg)\n    }\n    return fmt.Errorf(\"execute: %w\", err)\n}","handlingStrategy":"retry","validationCode":"if err := cfg.Validate(); err != nil {\n    return fmt.Errorf(\"invalid sandbox config: %w\", err)\n}\nif providerQuotaExceeded() { return errors.New(\"provider quota exhausted\") }","typeGuard":null,"tryCatchPattern":"handle, res, err := sbx.Execute(ctx, cfg)\nif err != nil && strings.Contains(err.Error(), \"remote sandbox: create\") {\n    if isTransient(err) { return backoffRetry(ctx, cfg) }\n    return err\n}","preventionTips":["Refresh provider credentials before long jobs","Check provider quota/capacity before bursty CI runs","Validate image and resource config against provider limits"],"tags":["go","sandbox","remote","creation-failure"],"backgroundTag":"sandbox-create-failed","analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}