{"record":{"id":"38377cf3fb3636e0","repo":"different-ai/openwork","slug":"failed-to-load-github-integrations-accountsresu","errorCode":null,"errorMessage":"Failed to load GitHub integrations (${accountsResult.response.status}).","messagePattern":"Failed to load GitHub integrations \\((.+?)\\)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ee/apps/den-web/app/(den)/dashboard/_components/integration-data.tsx","lineNumber":277,"sourceCode":"}\n\nfunction toRepoName(fullName: string) {\n  const parts = fullName.split(\"/\");\n  return parts[parts.length - 1] ?? fullName;\n}\n\nasync function simulateLatency(ms = 450) {\n  return new Promise<void>((resolve) => setTimeout(resolve, ms));\n}\n\nasync function fetchGithubConnections() {\n  const [accountsResult, instancesResult] = await Promise.all([\n    requestJson(\"/v1/connector-accounts?connectorType=github&status=active&limit=100\", { method: \"GET\" }, 15000),\n    requestJson(\"/v1/connector-instances?connectorType=github&status=active&limit=100\", { method: \"GET\" }, 15000),\n  ]);\n\n  if (!accountsResult.response.ok) {\n    throw new Error(getErrorMessage(accountsResult.payload, `Failed to load GitHub integrations (${accountsResult.response.status}).`));\n  }\n  if (!instancesResult.response.ok) {\n    throw new Error(getErrorMessage(instancesResult.payload, `Failed to load GitHub connector instances (${instancesResult.response.status}).`));\n  }\n\n  const accounts = parseGithubConnectorAccounts(accountsResult.payload);\n  const instances = parseGithubConnectorInstances(instancesResult.payload);\n\n  return accounts.map<ConnectedIntegration>((account) => ({\n    id: account.id,\n    provider: \"github\",\n    account: {\n      avatarInitial: toAvatarInitial(account.displayName),\n      createdByName: account.createdByName,\n      id: account.id,\n      installationId: account.remoteId ? Number(account.remoteId) : undefined,\n      kind: toAccountKind(account.metadata),\n      manageUrl: typeof account.metadata?.settingsUrl === \"string\" ? account.metadata.settingsUrl : null,","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/ee/apps/den-web/app/(den)/dashboard/_components/integration-data.tsx#L259-L295","documentation":"fetchGithubConnections calls GET /v1/connector-accounts?connectorType=github&status=active&limit=100 and throws this error when the response is not ok. The thrown message includes the HTTP status; getErrorMessage substitutes a server-provided message when the payload carries one. It is the accounts half of a parallel load (the instances error is separate).","triggerScenarios":"GET /v1/connector-accounts returns 401/403 (expired session or lacking org role), 404 (connector service not installed on the deployment), 429 (rate limit), or 5xx from the connector backend.","commonSituations":"Session expired after idle; non-admin viewing integrations in an org that restricts connector access; self-hosted deployment without the connector accounts service; GitHub app credentials misconfigured server-side causing 5xx.","solutions":["Check response.status in the message: 401/403 → re-authenticate or verify org permissions; 404 → ensure the connector service is deployed; 429 → retry later; 5xx → check server logs.","Refresh the session/sign in again if status is 401.","Confirm the GitHub connector app is configured on the server (client ID/secret, webhook).","Verify network/proxy connectivity to the Den API."],"exampleFix":"// before\nif (!accountsResult.response.ok) {\n  throw new Error(getErrorMessage(accountsResult.payload, `Failed to load GitHub integrations (${accountsResult.response.status}).`));\n}\n// after\nif (!accountsResult.response.ok) {\n  if (accountsResult.response.status === 401) { await reauthenticate(); return fetchGithubConnections(); }\n  throw new Error(getErrorMessage(accountsResult.payload, `Failed to load GitHub integrations (${accountsResult.response.status}).`));\n}","handlingStrategy":"try-catch","validationCode":"const res = await fetch(\"/v1/connector-accounts?connectorType=github&status=active&limit=100\", { credentials: \"include\" });\nif (!res.ok) console.warn(\"connector-accounts not loadable:\", res.status);","typeGuard":"null","tryCatchPattern":"try {\n  const integrations = await githubConnections();\n} catch (e) {\n  const msg = e instanceof Error ? e.message : String(e);\n  if (/\\(401\\)/.test(msg)) showReauthPrompt();\n  else if (/\\(404\\)/.test(msg)) showConnectorNotDeployedNotice();\n  else setError(msg);\n}","preventionTips":["Refresh the session before long-running dashboard sessions.","Gate the integrations screen on connector service availability.","Handle 429 with backoff for connector listing endpoints.","Monitor 5xx rates on /v1/connector-accounts in server metrics."],"tags":["http","github-connector","network"],"backgroundTag":"http-request-failed","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}