{"record":{"id":"8ab8d749d929847d","repo":"different-ai/openwork","slug":"github-connector-account-required","errorCode":"github_connector_account_required","errorMessage":"Connector account is not a GitHub account.","messagePattern":"Connector account is not a GitHub account\\.","errorType":"http","errorClass":"PluginArchRouteFailure","httpStatus":409,"severity":"error","filePath":"ee/apps/den-api/src/routes/org/plugin-system/store.ts","lineNumber":7036,"sourceCode":"  return {\n    autoImportNewPlugins: input.autoImportNewPlugins,\n    createdMarketplace,\n    connectorInstance: discovery.connectorInstance,\n    connectorTarget: discovery.connectorTarget,\n    createdPlugins: plugins,\n    createdMappings: mappings,\n    materializedConfigObjects,\n    sourceRevisionRef: discovery.cache.sourceRevisionRef,\n  }\n}\n\nexport async function listGithubRepositories(input: { connectorAccountId: ConnectorAccountId; context: PluginArchActorContext; cursor?: string; limit?: number; q?: string }) {\n  const account = await getConnectorAccountRow(input.context.organizationContext.organization.id, input.connectorAccountId)\n  if (!account) {\n    throw new PluginArchRouteFailure(404, \"connector_account_not_found\", \"Connector account not found.\")\n  }\n  if (account.connectorType !== \"github\") {\n    throw new PluginArchRouteFailure(409, \"github_connector_account_required\", \"Connector account is not a GitHub account.\")\n  }\n\n  const installationId = Number(account.remoteId)\n  if (!Number.isFinite(installationId) || installationId <= 0) {\n    throw new PluginArchRouteFailure(409, \"invalid_github_installation_id\", \"Connector account does not have a valid GitHub installation id.\")\n  }\n\n  let repositories: RepositorySummary[]\n  let installationSummary: Awaited<ReturnType<typeof getGithubInstallationSummary>>\n  try {\n    repositories = await listGithubInstallationRepositories({\n      config: githubConnectorAppConfig(),\n      installationId,\n    })\n    installationSummary = await getGithubInstallationSummary({\n      config: githubConnectorAppConfig(),\n      installationId,\n    })","sourceCodeStart":7018,"sourceCodeEnd":7054,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/ee/apps/den-api/src/routes/org/plugin-system/store.ts#L7018-L7054","documentation":"Thrown (409) by listGithubRepositories when the resolved connector account exists in the org but its `connectorType` is not \"github\". GitHub-specific listing (installation tokens, repo search) only works on GitHub accounts; the operation refuses to run against e.g. a google-drive or slack account.","triggerScenarios":"Passing a non-GitHub connectorAccountId (Google Drive, Slack, etc.) to listGithubRepositories; an account row whose connectorType was changed or mis-seeded; UI bug routing the wrong account id to the GitHub repo picker.","commonSituations":"Generic connector UI iterating all accounts and calling the GitHub endpoint for each; data migrations relabeling connector types; combining multiple connector types in one settings page with a shared 'browse repos' action.","solutions":["Pass a connector account with connectorType === 'github' — filter the account list before calling.","Use the type-appropriate listing API for non-GitHub accounts instead of listGithubRepositories.","If the account's connectorType is wrong in the DB, correct it via the proper connector flow or a data migration."],"exampleFix":"// before\nawait listGithubRepositories({ connectorAccountId: driveAccountId }) // google account -> 409\n// after\nconst account = await getConnectorAccount(driveAccountId)\nif (account.connectorType === 'github') {\n  await listGithubRepositories({ connectorAccountId: account.id })\n} else {\n  await listConnectorResourcesForType(account)\n}","handlingStrategy":"type-guard","validationCode":"const account = await getConnectorAccount(connectorAccountId)\nif (account.connectorType !== 'github') {\n  throw new Error(`Account ${account.id} is a ${account.connectorType} account; use the ${account.connectorType} listing API`)\n}","typeGuard":"function isGithubAccount(a: ConnectorAccountRow): a is ConnectorAccountRow & { connectorType: 'github' } { return a.connectorType === 'github' }","tryCatchPattern":"try {\n  await listGithubRepositories({ connectorAccountId })\n} catch (e) {\n  if (e instanceof PluginArchRouteFailure && e.code === 'github_connector_account_required') {\n    return listResourcesForConnectorType(account.connectorType, account.id)\n  } else throw e\n}","preventionTips":["Filter account lists by connectorType === 'github' before GitHub-specific calls","Type connector accounts as discriminated unions on connectorType","Route 'browse resources' actions through a dispatcher per connector type"],"tags":["github","type-mismatch","connector"],"backgroundTag":"connector-type-mismatch","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}