{"record":{"id":"2fdc435c69c6fb6e","repo":"different-ai/openwork","slug":"github-connector-app-not-configured","errorCode":"github_connector_app_not_configured","errorMessage":"${error.message}","messagePattern":"\\$\\{error\\.message\\}","errorType":"http","errorClass":"PluginArchRouteFailure","httpStatus":409,"severity":"error","filePath":"ee/apps/den-api/src/routes/org/plugin-system/store.ts","lineNumber":4333,"sourceCode":"      organizationId: instance.organizationId,\n      remoteId: target.remoteId,\n      sourceRevisionRef: null,\n      startedAt: new Date(),\n      status: \"queued\",\n      summaryJson: { trigger: \"manual\" },\n    })\n    enqueuedCount += 1\n  }\n\n  return { enqueuedCount }\n}\n\nfunction githubConnectorAppConfig() {\n  try {\n    return getGithubConnectorAppConfig(env.githubConnectorApp)\n  } catch (error) {\n    if (error instanceof GithubConnectorConfigError) {\n      throw new PluginArchRouteFailure(409, \"github_connector_app_not_configured\", error.message)\n    }\n    throw error\n  }\n}\n\nexport function consumeGithubInstallState(state: string) {\n  const parsed = verifyGithubInstallStateToken({ secret: env.betterAuthSecret, token: state })\n  if (!parsed) {\n    throw new PluginArchRouteFailure(400, \"invalid_github_install_state\", \"GitHub install state is invalid or expired.\")\n  }\n  return parsed\n}\n\nfunction wrapGithubConnectorError(error: unknown): never {\n  if (error instanceof PluginArchRouteFailure) {\n    throw error\n  }\n","sourceCodeStart":4315,"sourceCodeEnd":4351,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/ee/apps/den-api/src/routes/org/plugin-system/store.ts#L4315-L4351","documentation":"githubConnectorAppConfig() wraps getGithubConnectorAppConfig(env.githubConnectorApp) and converts GithubConnectorConfigError into a 409 PluginArchRouteFailure with code github_connector_app_not_configured. It signals the server-side GitHub Connector App environment configuration is missing or malformed, not a client problem. The message text is the underlying config error's message.","triggerScenarios":"Any GitHub connector route (install, callback, manifest) that calls githubConnectorAppConfig() while env.githubConnectorApp is unset, incomplete (missing app ID/private key/webhook secret), or unparseable.","commonSituations":"Fresh deployment where GITHUB_CONNECTOR_* env vars were never set; key file path wrong after a container image change; config schema drift after an upgrade; rotating the GitHub App private key with a bad paste.","solutions":["Set the complete GitHub connector app env config (app ID, private key, webhook secret, etc.) and restart the den-api server","Validate the env block locally by calling getGithubConnectorAppConfig with the same values before deploying","Check the private key is the full PEM including header/footer and newlines survived secret injection","Compare against the deployment's config docs / example env for required fields"],"exampleFix":"// before (env)\n# GITHUB_CONNECTOR_APP_ID= (empty, server not configured)\n// after (env)\nGITHUB_CONNECTOR_APP_ID=Iv1.abc123\nGITHUB_CONNECTOR_PRIVATE_KEY=-----BEGIN RSA PRIVATE KEY-----\\n...\\n-----END RSA PRIVATE KEY-----\nGITHUB_CONNECTOR_WEBHOOK_SECRET=whsec_...","handlingStrategy":"validation","validationCode":"// pre-flight at deploy time, outside a request\nimport { getGithubConnectorAppConfig, env } from \"./env\"\nconst cfg = getGithubConnectorAppConfig(env.githubConnectorApp) // throws if unset/invalid\nconsole.log(\"github connector app configured:\", cfg.appId)","typeGuard":"function isGithubAppNotConfigured(e: unknown): boolean {\n  return e instanceof PluginArchRouteFailure && e.code === \"github_connector_app_not_configured\"\n}","tryCatchPattern":"try {\n  return await githubConnectorInstallUrl(context)\n} catch (e) {\n  if (isGithubAppNotConfigured(e)) {\n    return respond(503, \"GitHub connector is not enabled on this deployment\")\n  }\n  throw e\n}","preventionTips":["Fail fast at server startup by validating the connector env config","Add the required GITHUB_CONNECTOR_* variables to deploy templates and CI","Verify PEM private keys survive secret-manager injection (newlines, header/footer)","Surface a deployment health check that reports connector config status"],"tags":["configuration","github-app","environment","http-409"],"backgroundTag":"missing-env-var","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}