{"record":{"id":"7cccc1e38655e0a6","repo":"paperclipai/paperclip","slug":"managed-workspace-readiness-gate-could-not-resolve-7cccc1","errorCode":null,"errorMessage":"Managed workspace readiness gate could not resolve the control-plane database","messagePattern":"Managed workspace readiness gate could not resolve the control-plane database","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/services/workspace-runtime.ts","lineNumber":6023,"sourceCode":"    // Transport readiness only proves a listener answered. A managed workspace\n    // must additionally satisfy the protected readiness contract — own database,\n    // cloned rows, login handoff, and matching instance/workspace identity —\n    // before it may be published as running/healthy (PAP-17572).\n    if (managedWorkspaceIdentity) {\n      const publishHealthUrl = resolveRuntimeServiceHealthUrl(\n        record.port ? `http://127.0.0.1:${record.port}` : rewriteUrlHostToLoopback(record.url ?? backendUrl),\n        { serviceName, command },\n      );\n      if (!publishHealthUrl) {\n        throw new Error(\"Managed workspace readiness gate could not resolve a health URL\");\n      }\n      let gate = await waitForManagedWorkspaceReadiness({\n        healthUrl: publishHealthUrl,\n        identity: managedWorkspaceIdentity,\n      });\n      if (gate.ok) {\n        if (!record.db) {\n          throw new Error(\"Managed workspace readiness gate could not resolve the control-plane database\");\n        }\n        gate = await probeManagedWorkspaceHandoffSubjects({\n          db: record.db,\n          healthUrl: publishHealthUrl,\n          identity: managedWorkspaceIdentity,\n        });\n      }\n      if (!gate.ok) {\n        logManagedWorkspaceReadinessRejection({\n          executionWorkspaceId: managedWorkspaceIdentity.executionWorkspaceId,\n          healthUrl: publishHealthUrl,\n          result: gate,\n        });\n        if (shouldBlockPublicationOnReadiness(gate)) {\n          throw new Error(\n            `Workspace is not ready to publish (${gate.reason}${gate.detail ? `: ${gate.detail}` : \"\"})`,\n          );\n        }","sourceCodeStart":6005,"sourceCodeEnd":6041,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/server/src/services/workspace-runtime.ts#L6005-L6041","documentation":"The managed-workspace readiness gate passed but record.db is unset, so the publish path has no control-plane database handle for the workspace; the readiness contract requires an own database before publishing healthy.","triggerScenarios":"Thrown at server/src/services/workspace-runtime.ts:6023 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify workspace database provisioning produced a db handle on the record","Check provisioning logs for a failed/cloned-database step","Re-provision the managed workspace","Inspect prior gate logs (PAP-17572 context) for the dropped db handle"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}