{"record":{"id":"42b60dcd479dc5d1","repo":"different-ai/openwork","slug":"failed-to-load-connection-name-s-apps-respon","errorCode":null,"errorMessage":"Failed to load ${connection.name}'s apps (${response.status}).","messagePattern":"Failed to load (.+?)'s apps \\((.+?)\\)\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ee/apps/den-web/app/(den)/dashboard/_components/org-dashboards-data.tsx","lineNumber":385,"sourceCode":"  });\n}\n\n/** A flat catalog containing only connections that expose launchable MCP Apps. */\nexport function useConnectionMcpAppCatalog(connections: Array<{ id: string; name: string }>) {\n  const { orgContext } = useOrgDashboard();\n  const organizationId = orgContext?.organization.id ?? \"\";\n  return useQueries({\n    queries: connections.map((connection) => ({\n      enabled: Boolean(organizationId),\n      queryKey: orgDashboardsQueryKeys.connectionApps(organizationId, connection.id),\n      queryFn: async (): Promise<ConnectionMcpApp[]> => {\n        const { response, payload } = await requestJson(\n          `/v1/mcp-connections/${encodeURIComponent(connection.id)}/mcp-apps`,\n          { method: \"GET\" },\n          20000,\n        );\n        if (!response.ok) {\n          throw new Error(getErrorMessage(payload, `Failed to load ${connection.name}'s apps (${response.status}).`));\n        }\n        const apps = isRecord(payload) && Array.isArray(payload.apps) ? payload.apps : [];\n        return apps.map(parseConnectionApp).filter((app): app is ConnectionMcpApp => app !== null);\n      },\n    })),\n    combine: (results) => {\n      const data = flattenConnectionMcpAppCatalog(connections, results.map((result) => result.data ?? []));\n      const isLoading = mcpAppCatalogIsLoading(data.length, results.some((result) => result.isPending));\n      return {\n        data,\n        isLoading,\n        error: data.length === 0 && !isLoading\n          ? results.find((result) => result.error)?.error ?? null\n          : null,\n      };\n    },\n  });\n}","sourceCodeStart":367,"sourceCodeEnd":403,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/ee/apps/den-web/app/(den)/dashboard/_components/org-dashboards-data.tsx#L367-L403","documentation":"useConnectionMcpAppCatalog fetches GET /v1/mcp-connections/:id/mcp-apps per connection and throws this error on a non-ok response. The interpolated connection name makes it clear which connection's catalog failed, and the status code hints at the cause.","triggerScenarios":"Non-2xx from the apps endpoint: 401 session expired, 403 no access to that MCP connection, 404 the connection was deleted while the dashboard was open, 408/timeout (20s budget) surfacing as an error status, 5xx server failure.","commonSituations":"An MCP connection removed by an admin while a dashboard referencing it is open; gateway timeout because the MCP server is slow to enumerate apps; expired Den session; connection pointing at an unreachable MCP server.","solutions":["Use the name/status in the message to identify the failing connection, then check its existence and your access on the connections screen","For timeouts, verify the MCP server is reachable and responding quickly, then retry","Re-sign-in if the status is 401","If the connection no longer exists, remove or recreate it and reload the dashboard"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// skip the catalog query for connections known to be unreachable\nif (connection.status !== 'connected') return [];","typeGuard":null,"tryCatchPattern":"const appsQuery = useConnectionMcpAppCatalog(connection);\nconst apps = appsQuery.data ?? [];\nif (appsQuery.error) {\n  showPerConnectionWarning(connection.name, appsQuery.error.message); // render rest of dashboard normally\n}","preventionTips":["Render a per-connection error card instead of failing the whole dashboard","Check connection health/status before fetching its app catalog","Keep the 20s timeout but surface it as 'server slow' to the user","Remove stale MCP connections promptly so dependent dashboards stop querying them"],"tags":["http","network","mcp","api"],"backgroundTag":"http-error-response","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}