{"record":{"id":"79049fcb0e2e6643","repo":"paperclipai/paperclip","slug":"cloud-portfolio-not-configured","errorCode":"cloud_portfolio_not_configured","errorMessage":"Paperclip Cloud portfolio is not configured","messagePattern":"Paperclip Cloud portfolio is not configured","errorType":"http","errorClass":"HttpError","httpStatus":503,"severity":"error","filePath":"server/src/routes/cloud.ts","lineNumber":43,"sourceCode":"  const fetchImpl = opts.fetchImpl ?? fetch;\n  const now = opts.now ?? Date.now;\n  const cacheTtlMs = opts.cacheTtlMs ?? DEFAULT_PORTFOLIO_CACHE_TTL_MS;\n  const portfolioCache = new Map<string, PortfolioCacheEntry>();\n\n  router.get(\"/stacks\", async (req, res) => {\n    const context = getCloudStackContext(runtimeEnv);\n    if (!context) {\n      throw notFound(\"Cloud stack portfolio is unavailable\");\n    }\n    if (req.actor.source !== \"cloud_tenant\" || !req.actor.userId?.trim()) {\n      throw forbidden(\"Trusted Cloud tenant access required\", {\n        code: \"cloud_tenant_required\",\n      });\n    }\n\n    const tenantToken = runtimeEnv.PAPERCLIP_CLOUD_TENANT_SERVER_TOKEN?.trim();\n    if (!context.cloudOrigin || !context.stackId || !tenantToken) {\n      throw new HttpError(503, \"Paperclip Cloud portfolio is not configured\", {\n        code: \"cloud_portfolio_not_configured\",\n      });\n    }\n\n    const actorUserId = req.actor.userId.trim();\n    const cacheKey = `${context.cloudOrigin}\\n${context.stackId}\\n${actorUserId}`;\n    const currentTime = now();\n    for (const [key, entry] of portfolioCache) {\n      if (entry.expiresAt <= currentTime) portfolioCache.delete(key);\n    }\n    const cached = portfolioCache.get(cacheKey);\n    if (cached) {\n      res.setHeader(\"Cache-Control\", \"no-store\");\n      res.json(cached.payload);\n      return;\n    }\n\n    let portfolioUrl: URL;","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/server/src/routes/cloud.ts#L25-L61","documentation":"Cloud-stack context failure in cloudRoutes: runtimeEnv carries no Paperclip Cloud portfolio configuration (no portfolio URL/tenant setup), so the /stacks route cannot build an upstream request. Signaled as an HTTP error rather than an empty list so the UI can show the feature is unavailable.","triggerScenarios":"Thrown at server/src/routes/cloud.ts:43 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Configure the Paperclip Cloud portfolio settings for this instance before calling the cloud portfolio endpoint."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}