{"record":{"id":"5cac3e1959869ad4","repo":"bytedance/deer-flow","slug":"github-app-id-raw-r-is-not-an-integer","errorCode":null,"errorMessage":"GITHUB_APP_ID={raw!r} is not an integer","messagePattern":"GITHUB_APP_ID=(.+?) is not an integer","errorType":"exception","errorClass":"GitHubAppAuthError","httpStatus":null,"severity":"error","filePath":"backend/app/gateway/github/app_auth.py","lineNumber":93,"sourceCode":"        if lock is None:\n            lock = asyncio.Lock()\n            _install_locks[installation_id] = lock\n        return lock\n\n\ndef app_id() -> int:\n    \"\"\"Return the configured GitHub App id, or raise if unset.\n\n    Read fresh on every call so operators can rotate it without a process\n    restart.\n    \"\"\"\n    raw = os.environ.get(_APP_ID_ENV)\n    if not raw:\n        raise GitHubAppAuthError(f\"{_APP_ID_ENV} is not set\")\n    try:\n        return int(raw.strip())\n    except ValueError as exc:\n        raise GitHubAppAuthError(f\"{_APP_ID_ENV}={raw!r} is not an integer\") from exc\n\n\ndef load_app_private_key() -> str:\n    \"\"\"Return the App's RSA private key as a PEM string.\n\n    Reads from ``GITHUB_APP_PRIVATE_KEY`` (inline PEM) if set, else from\n    the path in ``GITHUB_APP_PRIVATE_KEY_PATH``. Inline takes precedence\n    so operators can roll a key by setting an env var instead of moving\n    files around in production.\n    \"\"\"\n    inline = os.environ.get(_PRIVATE_KEY_ENV)\n    if inline and inline.strip():\n        return inline\n\n    path = os.environ.get(_PRIVATE_KEY_PATH_ENV)\n    if not path:\n        raise GitHubAppAuthError(f\"Neither {_PRIVATE_KEY_ENV} nor {_PRIVATE_KEY_PATH_ENV} is set\")\n    p = Path(path).expanduser()","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/app/gateway/github/app_auth.py#L75-L111","documentation":"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.","triggerScenarios":"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 }}'.","commonSituations":"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.","solutions":["Get the numeric App ID from GitHub -> Settings -> Developer settings -> GitHub Apps -> (your app); it is an integer like 861753","Set the env var to exactly that integer string, no quotes-templating or units: GITHUB_APP_ID=861753","If using templated config (Helm/compose), render and inspect the final value the container sees: `docker exec <gateway> printenv GITHUB_APP_ID`","For Kubernetes secrets, ensure the value is plain (stringData: GITHUB_APP_ID: \"861753\") not base64-of-base64"],"exampleFix":"# before\nGITHUB_APP_ID=\"my-ci-app\"          # not an integer -> GitHubAppAuthError\n# after\nGITHUB_APP_ID=\"861753\"","handlingStrategy":"validation","validationCode":"import os\nraw = os.environ.get('GITHUB_APP_ID', '')\nif not raw.isdigit():\n    raise ConfigError(f'GITHUB_APP_ID must be numeric, got {raw!r}')","typeGuard":"null","tryCatchPattern":"except GitHubAppAuthError as e:\n    if 'is not an integer' in str(e):\n        log_config_error('GITHUB_APP_ID must be the numeric App ID from GitHub App settings')\n    raise","preventionTips":["Copy the App ID from GitHub's Developer settings, never retype it","Validate numeric-ness in config CI/lint for all GitHub integration envs","Render and inspect final container env (`printenv`) after template changes"],"tags":["github-app","environment-variables","misconfiguration","validation"],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}