{"record":{"id":"c71da8114c073303","repo":"paperclipai/paperclip","slug":"execution-workspace-not-found-before-starting-runt","errorCode":null,"errorMessage":"Execution workspace not found before starting runtime services","messagePattern":"Execution workspace not found before starting runtime services","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/services/workspace-runtime.ts","lineNumber":7143,"sourceCode":"}\n\nasync function lockWorkspaceRuntimeStartParents(\n  db: Db,\n  input: StartRuntimeServicesForWorkspaceControlInput,\n) {\n  let allowFixedPortFallback = false;\n  if (input.executionWorkspaceId) {\n    const [lockedExecutionWorkspace] = await db\n      .select({ id: executionWorkspaces.id, mode: executionWorkspaces.mode })\n      .from(executionWorkspaces)\n      .where(\n        and(\n          eq(executionWorkspaces.id, input.executionWorkspaceId),\n          eq(executionWorkspaces.companyId, input.actor.companyId),\n        ),\n      )\n      .for(\"update\");\n    if (!lockedExecutionWorkspace) throw new Error(\"Execution workspace not found before starting runtime services\");\n    allowFixedPortFallback = lockedExecutionWorkspace.mode === \"isolated_workspace\";\n  }\n\n  if (input.workspace.workspaceId) {\n    const [lockedProjectWorkspace] = await db\n      .select({ id: projectWorkspaces.id })\n      .from(projectWorkspaces)\n      .where(\n        and(\n          eq(projectWorkspaces.id, input.workspace.workspaceId),\n          eq(projectWorkspaces.companyId, input.actor.companyId),\n        ),\n      )\n      .for(\"update\");\n    if (!lockedProjectWorkspace) throw new Error(\"Project workspace not found before starting runtime services\");\n  }\n\n  return allowFixedPortFallback;","sourceCodeStart":7125,"sourceCodeEnd":7161,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/server/src/services/workspace-runtime.ts#L7125-L7161","documentation":"lockWorkspaceRuntimeStartParents took a FOR UPDATE lock on the execution workspace row referenced by executionWorkspaceId and found no row in this company. The workspace was deleted or belongs to another company before runtime services could start.","triggerScenarios":"Thrown at server/src/services/workspace-runtime.ts:6505 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the execution workspace exists before starting runtime services; create or re-link it, then retry.","Check that the workspace id being referenced is still valid and not deleted."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}