{"record":{"id":"bdd7e942f0a61498","repo":"paperclipai/paperclip","slug":"reconciled-stale-managed-runtime-control-operation","errorCode":null,"errorMessage":"reconciled stale managed runtime control operations from a previous server process","messagePattern":"reconciled stale managed runtime control operations from a previous server process","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/index.ts","lineNumber":864,"sourceCode":"    // upgrade behind the Cloud front door 403s forever. The resolver is\n    // self-gating: it returns null unless PAPERCLIP_CLOUD_TENANT_SERVER_TOKEN\n    // is configured and the request presents the matching trust token, so\n    // self-hosted deployments never take this path.\n    resolveCloudActor: async (req) => {\n      const actor = await resolveCloudTenantActor(\n        db as any,\n        cloudActorHeaderSourceFromHeaders(req.headers),\n      );\n      if (!actor?.userId || !actor.companyIds) return null;\n      return { userId: actor.userId, companyIds: actor.companyIds };\n    },\n  });\n\n  try {\n    const result = await workspaceOperationService(db as any)\n      .reconcileStaleRuntimeControlOperations();\n    if (result.reconciled > 0) {\n      logger.warn(\n        { reconciled: result.reconciled, operationIds: result.operationIds },\n        \"reconciled stale managed runtime control operations from a previous server process\",\n      );\n    }\n  } catch (err) {\n    logger.error({ err }, \"startup reconciliation of managed runtime control operations failed\");\n  }\n\n  void reconcilePersistedRuntimeServicesOnStartup(db as any)\n    .then((result) => {\n      if (\n        result.reconciled > 0\n        || result.restarted > 0\n        || result.restartFailed > 0\n        || result.backfilled > 0\n      ) {\n        logger.warn(\n          {","sourceCodeStart":846,"sourceCodeEnd":882,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/server/src/index.ts#L846-L882","documentation":"Startup reconciliation log in startServer. Fires when reconcileManagedRuntimeControlOperationsOnStartup found and reconciled stale managed runtime control operations left behind by a previous server process (operationIds listed).","triggerScenarios":"Thrown at server/src/index.ts:825 when the library encounters an invalid state.","commonSituations":"Logged at startup when managed runtime control operations left in a pending state by a previous (crashed or killed) server process are reconciled.","solutions":["Informational only; stale control operations from the previous process were cleaned up.","If this appears on every startup, ensure the server shuts down gracefully so operations are finalized."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}