different-ai/openwork · error · PluginArchRouteFailure

github_connector_app_not_configured

github_connector_app_not_configured

Error message

${error.message}

What it means

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.

Solutions

  1. Set the complete GitHub connector app env config (app ID, private key, webhook secret, etc.) and restart the den-api server
  2. Validate the env block locally by calling getGithubConnectorAppConfig with the same values before deploying
  3. Check the private key is the full PEM including header/footer and newlines survived secret injection
  4. Compare against the deployment's config docs / example env for required fields

Example fix

// before (env)
# GITHUB_CONNECTOR_APP_ID= (empty, server not configured)
// after (env)
GITHUB_CONNECTOR_APP_ID=Iv1.abc123
GITHUB_CONNECTOR_PRIVATE_KEY=-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----
GITHUB_CONNECTOR_WEBHOOK_SECRET=whsec_...
Defensive patterns

Strategy: validation

Validate before calling

// pre-flight at deploy time, outside a request
import { getGithubConnectorAppConfig, env } from "./env"
const cfg = getGithubConnectorAppConfig(env.githubConnectorApp) // throws if unset/invalid
console.log("github connector app configured:", cfg.appId)

Type guard

function isGithubAppNotConfigured(e: unknown): boolean {
  return e instanceof PluginArchRouteFailure && e.code === "github_connector_app_not_configured"
}

Try / catch

try {
  return await githubConnectorInstallUrl(context)
} catch (e) {
  if (isGithubAppNotConfigured(e)) {
    return respond(503, "GitHub connector is not enabled on this deployment")
  }
  throw e
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of different-ai/openwork@2b7df46e8a (2026-09-01). Data as JSON: /api/errors/2fdc435c69c6fb6e. Report an issue: GitHub.

Appendix: source

Thrown at ee/apps/den-api/src/routes/org/plugin-system/store.ts:4333

      organizationId: instance.organizationId,
      remoteId: target.remoteId,
      sourceRevisionRef: null,
      startedAt: new Date(),
      status: "queued",
      summaryJson: { trigger: "manual" },
    })
    enqueuedCount += 1
  }

  return { enqueuedCount }
}

function githubConnectorAppConfig() {
  try {
    return getGithubConnectorAppConfig(env.githubConnectorApp)
  } catch (error) {
    if (error instanceof GithubConnectorConfigError) {
      throw new PluginArchRouteFailure(409, "github_connector_app_not_configured", error.message)
    }
    throw error
  }
}

export function consumeGithubInstallState(state: string) {
  const parsed = verifyGithubInstallStateToken({ secret: env.betterAuthSecret, token: state })
  if (!parsed) {
    throw new PluginArchRouteFailure(400, "invalid_github_install_state", "GitHub install state is invalid or expired.")
  }
  return parsed
}

function wrapGithubConnectorError(error: unknown): never {
  if (error instanceof PluginArchRouteFailure) {
    throw error
  }

View on GitHub (pinned to 2b7df46e8a)