{"record":{"id":"389baf2bdc9a1797","repo":"paperclipai/paperclip","slug":"daytona-sandbox-lease-scope-providerleaseid-is","errorCode":null,"errorMessage":"Daytona sandbox lease ${scope.providerLeaseId} is no longer active.","messagePattern":"Daytona sandbox lease (.+?) is no longer active\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/plugins/sandbox-providers/daytona/src/plugin.ts","lineNumber":1189,"sourceCode":"\n  function open(scope: SandboxScope): void {\n    states.set(key(scope), false);\n  }\n\n  function close(scope: SandboxScope): void {\n    states.set(key(scope), true);\n  }\n\n  function isClosed(scope: SandboxScope): boolean {\n    return states.get(key(scope)) === true;\n  }\n\n  function reset(): void {\n    states.clear();\n  }\n\n  return { open, close, isClosed, reset };\n})();\n\nasync function withSandboxActivityGate<T>(\n  scope: SandboxScope,\n  fn: () => Promise<T>,\n  options: SandboxLeaseAdmissionOptions = {},\n): Promise<T> {\n  while (true) {\n    if (!options.allowClosed && sandboxHandleLeaseAdmissionStates.isClosed(scope)) {\n      throw new Error(`Daytona sandbox lease ${scope.providerLeaseId} is no longer active.`);\n    }\n\n    const teardownGate = sandboxHandleTeardownGates.current(scope);\n    if (teardownGate) {\n      await teardownGate.promise;\n      if (!options.allowClosed && sandboxHandleLeaseAdmissionStates.isClosed(scope)) {\n        throw new Error(`Daytona sandbox lease ${scope.providerLeaseId} is no longer active.`);\n      }\n      continue;","sourceCodeStart":1171,"sourceCodeEnd":1207,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/packages/plugins/sandbox-providers/daytona/src/plugin.ts#L1171-L1207","documentation":"Admission gate failure in withSandboxActivityGate: the sandbox lease admission tracker has marked this scope (providerLeaseId) as closed — a concurrent release/destroy already tore the lease down — and the current operation does not run with allowClosed. Subsequent activity on the dead lease is rejected instead of racing teardown.","triggerScenarios":"Thrown at packages/plugins/sandbox-providers/daytona/src/plugin.ts:1136 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Acquire a new sandbox lease; the previous lease has ended."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}