{"record":{"id":"356a99b29cbe8b57","repo":"paperclipai/paperclip","slug":"kubernetes-file-sync-requires-a-provider-lease-id","errorCode":null,"errorMessage":"Kubernetes file sync requires a provider lease ID.","messagePattern":"Kubernetes file sync requires a provider lease ID\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/plugins/sandbox-providers/kubernetes/src/plugin.ts","lineNumber":148,"sourceCode":"  }\n  throw new Error(\"Kubernetes file sync requires a workspace remote dir on the lease metadata.\");\n}\n\n/**\n * Resolve the running Sandbox-CR pod for a native file-sync operation and return\n * a `PodStreamExec` bound to it, exactly like `onEnvironmentExecute` resolves its exec\n * target: parse config, derive the namespace, wait for the Sandbox pod to reach\n * Ready (cached per lease), and find the pod name. The `job` backend carries no\n * file path and is out of scope — file sync is only supported on `sandbox-cr`.\n */\nasync function resolveSyncPodExec(\n  params:\n    | PluginEnvironmentSyncInParams\n    | PluginEnvironmentSyncOutParams,\n): Promise<{ exec: PodStreamExec; timeoutMs: number }> {\n  const { lease } = params;\n  if (!lease.providerLeaseId) {\n    throw new Error(\"Kubernetes file sync requires a provider lease ID.\");\n  }\n\n  const config = kubernetesProviderConfigSchema.parse(params.config);\n  const namespace =\n    typeof lease.metadata?.namespace === \"string\"\n      ? lease.metadata.namespace\n      : deriveTenantNamespace(config, params.companyId);\n\n  const leaseBackend =\n    typeof lease.metadata?.backend === \"string\"\n      ? (lease.metadata.backend as \"sandbox-cr\" | \"job\")\n      : config.backend;\n  if (leaseBackend !== \"sandbox-cr\") {\n    throw new Error(\n      `Kubernetes file sync is only supported on the sandbox-cr backend (lease backend: ${leaseBackend}).`,\n    );\n  }\n","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/packages/plugins/sandbox-providers/kubernetes/src/plugin.ts#L130-L166","documentation":"Error \"Kubernetes file sync requires a provider lease ID.\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at packages/plugins/sandbox-providers/kubernetes/src/plugin.ts:148 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a provider lease ID on the lease metadata before file sync."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}