{"record":{"id":"6ec74524987f3a18","repo":"paperclipai/paperclip","slug":"project-workspace-not-found-before-starting-runtim","errorCode":null,"errorMessage":"Project workspace not found before starting runtime services","messagePattern":"Project workspace not found before starting runtime services","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/services/workspace-runtime.ts","lineNumber":7158,"sourceCode":"        ),\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;\n}\n\nfunction canRetryDeferredPortBindCollision(\n  service: Record<string, unknown>,\n  allowFixedPortFallback: boolean,\n) {\n  const portConfig = parseObject(service.port);\n  const portType = asString(portConfig.type, \"\");\n  const explicitPort = asNumber(portConfig.value, asNumber(service.port, 0));\n  return portType === \"auto\" || Boolean(allowFixedPortFallback && explicitPort > 0);\n}\n\nasync function discardFailedDeferredRuntimeStart(db: Db, record: RuntimeServiceRecord) {\n  clearIdleTimer(record);\n  if (runtimeServicesById.get(record.id) === record) runtimeServicesById.delete(record.id);","sourceCodeStart":7140,"sourceCodeEnd":7176,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/server/src/services/workspace-runtime.ts#L7140-L7176","documentation":"The same locking path selected the referenced project workspace FOR UPDATE and found no row for this company. The project workspace disappeared or is out of scope, so parent locking for runtime service start fails.","triggerScenarios":"Thrown at server/src/services/workspace-runtime.ts:6520 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the project workspace exists before starting runtime services; recreate or re-link it, then retry.","Verify the project still references a valid workspace."],"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-14T05:17:10.506Z"}