{"record":{"id":"f4b0f2a5490eb11f","repo":"different-ai/openwork","slug":"failed-to-load-github-connector-instances-insta","errorCode":null,"errorMessage":"Failed to load GitHub connector instances (${instancesResult.response.status}).","messagePattern":"Failed to load GitHub connector instances \\((.+?)\\)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ee/apps/den-web/app/(den)/dashboard/_components/integration-data.tsx","lineNumber":280,"sourceCode":"  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,\n      name: account.displayName,\n      ownerName: account.externalAccountRef ?? (typeof account.metadata?.accountLogin === \"string\" ? account.metadata.accountLogin : undefined),\n      repositorySelection: account.metadata?.repositorySelection === \"selected\" ? \"selected\" : \"all\",","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/ee/apps/den-web/app/(den)/dashboard/_components/integration-data.tsx#L262-L298","documentation":"The second half of fetchGithubConnections: GET /v1/connector-instances?connectorType=github&status=active&limit=100 returned a non-ok status. Thrown only after the accounts call already passed, so accounts load fine but the per-account repository instances cannot be fetched.","triggerScenarios":"GET /v1/connector-instances returns 401/403 (auth/role issue), 404 (instances service missing), 429, or 5xx from the connector backend while the accounts endpoint succeeds.","commonSituations":"Partial deployment where connector-instances route is missing or behind a broken service; transient 5xx in the instances microservice; permissions that allow listing accounts but not instances.","solutions":["Read the status code: 401/403 → re-auth/permissions; 404 → deploy/fix the connector-instances service; 5xx → check that service's logs.","Retry the request if transient (the UI query layer can refetch).","Confirm both connector routes are registered on the same API gateway.","Compare server-side logs for the correlation between the accounts (ok) and instances (failed) calls."],"exampleFix":"// before\nif (!instancesResult.response.ok) {\n  throw new Error(getErrorMessage(instancesResult.payload, `Failed to load GitHub connector instances (${instancesResult.response.status}).`));\n}\n// after\nif (!instancesResult.response.ok) {\n  if (instancesResult.response.status >= 500) {\n    instancesResult = await requestJson(\"/v1/connector-instances?connectorType=github&status=active&limit=100\", { method: \"GET\" }, 15000);\n  }\n  if (!instancesResult.response.ok) throw new Error(getErrorMessage(instancesResult.payload, `Failed to load GitHub connector instances (${instancesResult.response.status}).`));\n}","handlingStrategy":"retry","validationCode":"const res = await fetch(\"/v1/connector-instances?connectorType=github&status=active&limit=100\", { credentials: \"include\" });\nif (res.status >= 500 || res.status === 429) scheduleRetry();","typeGuard":"null","tryCatchPattern":"try {\n  const integrations = await githubConnections();\n} catch (e) {\n  if (isTransient(e)) retryWithBackoff(githubConnections, 3);\n  else setError(e instanceof Error ? e.message : \"Failed to load GitHub integrations.\");\n}","preventionTips":["Wrap connector fetches in retry-with-backoff for 429/5xx.","Confirm both connector routes are deployed together.","Use TanStack Query retry semantics for transient statuses.","Alert on instances-endpoint errors separately from accounts."],"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"}