{"record":{"id":"7f6acf88c460ac43","repo":"paperclipai/paperclip","slug":"execution-workspace-needs-a-local-path-before-pape-7f6acf","errorCode":null,"errorMessage":"Execution workspace needs a local path before Paperclip can restart it.","messagePattern":"Execution workspace needs a local path before Paperclip can restart it\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/routes/execution-workspaces.ts","lineNumber":811,"sourceCode":"                \"Verified seed manifest belongs to a different workspace instance.\",\n              );\n            }\n            resolveCanonicalWorktreeSeedSource({\n              registeredBaseWorkspaceCwd: baseWorkspaceCwd,\n              explicitSourceConfigPath: resolveFallbackSeedSourceConfigPath(baseWorkspaceCwd),\n              targetConfigPath: path.join(workspaceCwd, \".paperclip\", \"config.json\"),\n              expectedTargetInstanceId: repairSeedSource.targetInstanceId,\n              manifestSource: manifest.source as { configPath?: unknown; instanceId?: unknown } | undefined,\n              manifestTargetInstanceId: manifest.targetInstanceId,\n            });\n            await reportRepairPhase(\"full_reseed\", \"succeeded\");\n\n            await reportRepairPhase(\"managed_restart\", \"started\");\n            let startedServices: Awaited<ReturnType<typeof startRuntimeServicesForWorkspaceControl>> = [];\n            if (repairRestartsRuntimeServices) {\n              const availableWorkspace = await ensureWorkspaceAvailable();\n              if (!availableWorkspace) {\n                throw new Error(\"Execution workspace needs a local path before Paperclip can restart it.\");\n              }\n              startedServices = await startRuntimeServicesForWorkspaceControl({\n                db,\n                actor: {\n                  id: actor.agentId ?? null,\n                  name: actor.actorType === \"user\" ? \"Board\" : \"Agent\",\n                  companyId: existing.companyId,\n                },\n                issue: existing.sourceIssueId\n                  ? { id: existing.sourceIssueId, identifier: null, title: existing.name }\n                  : null,\n                workspace: availableWorkspace,\n                executionWorkspaceId: existing.id,\n                config: {\n                  workspaceRuntime: effectiveRuntimeConfig,\n                  runtimeProvisionCommand:\n                    existing.config?.runtimeProvisionCommand\n                    ?? projectPolicy?.workspaceStrategy?.runtimeProvisionCommand","sourceCodeStart":793,"sourceCodeEnd":829,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/server/src/routes/execution-workspaces.ts#L793-L829","documentation":"Thrown in the managed_restart phase of repair when the flow is about to restart configured runtime services (repairRestartsRuntimeServices is true) but ensureWorkspaceAvailable() returns falsy. Restarting services requires a usable local path for the execution workspace; the route checked existing.cwd at entry, so this fires when local-path availability fails at restart time — the record lost its cwd mid-operation or the path is no longer usable on the host. It aborts the repair after the reseed succeeded but before services come back.","triggerScenarios":"POST repair with action=repair on a workspace whose effective runtime config defines services, where the database reseed completes but ensureWorkspaceAvailable() (called just before startRuntimeServicesForWorkspaceControl at server/src/routes/execution-workspaces.ts:811) cannot resolve an available local workspace — cwd cleared, workspace directory deleted during the repair, or availability check failing.","commonSituations":"Someone deletes or moves the worktree directory while a long repair is running; the workspace record was edited concurrently to remove its local path; the availability check fails because the path exists but is not accessible (permissions, unmounted disk); environments where the worktree lives on removable/network storage.","solutions":["Verify the execution workspace still has its cwd and that the directory exists and is readable on the server host.","Re-check the workspace record for concurrent modifications (another operator/agent clearing the path) and restore the local path registration.","Since the database reseed already succeeded, restart services manually via the start/restart action once the path is available — you do not need a full repair re-run.","If the worktree directory was destroyed, re-create the execution workspace instead of trying to restart it."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const ws = await api.getExecutionWorkspace(id);\nif (!ws.cwd || !existsSync(ws.cwd)) throw new Error(\"Workspace local path missing/unavailable; restore it before repair with service restart.\");","typeGuard":"function hasUsableLocalPath(ws: { cwd: string | null }): boolean {\n  return typeof ws.cwd === \"string\" && ws.cwd.length > 0;\n}","tryCatchPattern":"try { await repair(id); } catch (err) { if (/needs a local path/.test(String(err?.body?.error ?? \"\"))) { /* reseed already done — just fix path and call start/restart */ await restartServices(id); } else throw err; }","preventionTips":["Do not delete or move worktree directories while repairs are running.","Keep worktrees on storage that stays mounted for the whole repair window.","After this error, remember the database repair succeeded — only the service restart needs redoing."],"tags":["workspace","repair","restart","local-path","paperclip"],"backgroundTag":"missing-filesystem-path","analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-21T17:58:32.592Z","contentChangedAt":"2026-08-21T17:58:32.592Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}