{"record":{"id":"852f505c58024110","repo":"paperclipai/paperclip","slug":"kubernetes-file-sync-requires-a-workspace-remote-d","errorCode":null,"errorMessage":"Kubernetes file sync requires a workspace remote dir on the lease metadata.","messagePattern":"Kubernetes file sync requires a workspace remote dir on the lease metadata\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/plugins/sandbox-providers/kubernetes/src/plugin.ts","lineNumber":131,"sourceCode":"\n// How long onEnvironmentResumeLease waits for an existing Sandbox pod to\n// report Ready before declaring the lease non-resumable. Deliberately short:\n// this is a liveness check on an already-provisioned pod, not a fresh\n// provision — if the pod isn't (almost) up, falling back to acquireLease is\n// faster and more reliable than waiting.\nconst RESUME_READY_TIMEOUT_MS = 30_000;\nconst RESUME_READY_POLL_MS = 1_000;\n\n// The workspace remote dir is the confinement root for native file sync. It is\n// recorded on the lease metadata at realizeWorkspace time (`remoteCwd`); require\n// it so a sync can never run without a concrete root to confine every sandbox\n// path against.\nfunction resolveSyncRemoteDir(lease: PluginEnvironmentLease): string {\n  const remoteCwd = lease.metadata?.remoteCwd;\n  if (typeof remoteCwd === \"string\" && remoteCwd.trim().length > 0) {\n    return remoteCwd.trim();\n  }\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  }","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/packages/plugins/sandbox-providers/kubernetes/src/plugin.ts#L113-L149","documentation":"Error \"Kubernetes file sync requires a workspace remote dir on the lease metadata.\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at packages/plugins/sandbox-providers/kubernetes/src/plugin.ts:131 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the lease metadata includes workspaceRemoteDir 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-14T05:17:10.506Z"}