bytedance/deer-flow · error · GitHubAppAuthError

GITHUB_APP_ID={raw!r} is not an integer

Error message

GITHUB_APP_ID={raw!r} is not an integer

What it means

GitHubAppAuthError raised by app_id() when GITHUB_APP_ID is set but its value does not parse as an integer (after strip). GitHub App ids are numeric; a non-numeric value indicates a copy/paste or templating mistake.

Source

Thrown at backend/app/gateway/github/app_auth.py:93

        if lock is None:
            lock = asyncio.Lock()
            _install_locks[installation_id] = lock
        return lock


def app_id() -> int:
    """Return the configured GitHub App id, or raise if unset.

    Read fresh on every call so operators can rotate it without a process
    restart.
    """
    raw = os.environ.get(_APP_ID_ENV)
    if not raw:
        raise GitHubAppAuthError(f"{_APP_ID_ENV} is not set")
    try:
        return int(raw.strip())
    except ValueError as exc:
        raise GitHubAppAuthError(f"{_APP_ID_ENV}={raw!r} is not an integer") from exc


def load_app_private_key() -> str:
    """Return the App's RSA private key as a PEM string.

    Reads from ``GITHUB_APP_PRIVATE_KEY`` (inline PEM) if set, else from
    the path in ``GITHUB_APP_PRIVATE_KEY_PATH``. Inline takes precedence
    so operators can roll a key by setting an env var instead of moving
    files around in production.
    """
    inline = os.environ.get(_PRIVATE_KEY_ENV)
    if inline and inline.strip():
        return inline

    path = os.environ.get(_PRIVATE_KEY_PATH_ENV)
    if not path:
        raise GitHubAppAuthError(f"Neither {_PRIVATE_KEY_ENV} nor {_PRIVATE_KEY_PATH_ENV} is set")
    p = Path(path).expanduser()

View on GitHub (pinned to 1dd6ba1acb)

Solutions

  1. Get the numeric App ID from GitHub -> Settings -> Developer settings -> GitHub Apps -> (your app); it is an integer like 861753
  2. Set the env var to exactly that integer string, no quotes-templating or units: GITHUB_APP_ID=861753
  3. If using templated config (Helm/compose), render and inspect the final value the container sees: `docker exec <gateway> printenv GITHUB_APP_ID`
  4. For Kubernetes secrets, ensure the value is plain (stringData: GITHUB_APP_ID: "861753") not base64-of-base64

Example fix

# before
GITHUB_APP_ID="my-ci-app"          # not an integer -> GitHubAppAuthError
# after
GITHUB_APP_ID="861753"
Defensive patterns

Strategy: validation

Validate before calling

import os
raw = os.environ.get('GITHUB_APP_ID', '')
if not raw.isdigit():
    raise ConfigError(f'GITHUB_APP_ID must be numeric, got {raw!r}')

Type guard

null

Try / catch

except GitHubAppAuthError as e:
    if 'is not an integer' in str(e):
        log_config_error('GITHUB_APP_ID must be the numeric App ID from GitHub App settings')
    raise

Prevention

When it happens

Trigger: Calling app_id() with GITHUB_APP_ID containing text such as the App name, a slug, quotes, or an unexpanded template placeholder like '${GITHUB_APP_ID}' or '{{ .Values.appId }}'.

Common situations: Operator pasted the App's display name instead of its numeric id from the GitHub App settings; Helm/compose template left unrendered because the surrounding quotes were escaped; value copied with surrounding prose or whitespace-truncated JSON; base64-encoded secret not decoded.

Related errors


AI-assisted analysis of bytedance/deer-flow@1dd6ba1acb (2026-08-14). Data as JSON: /api/errors/5cac3e1959869ad4. Report an issue: GitHub.