bug: GitHub App installation token 404 in ckit_github

Open
#302 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Quiet
Tech stack
github, python

Research direction

Start in flexus_client_kit/ckit_github.py at exchange_installation_id_to_token around line 90, then review the logged request and GitHub's create-installation-access-token requirements. Verify how the installation ID, client ID, private key, and repository name are supplied; done means the devenv startup can exchange the installation ID without the reported 404.

Written by the indexing model from the issue text.

Description

bug

Original Logs

20260409 13:55:58.459 flexus_client_kit.ckit_github [ERROR] 🛑 Failed to get installation token: 404 {"message":"Not Found","documentation_url":"https://docs.github.com/rest/reference/apps#create-an-installation-access-token-for-an-app","status":"404"}

Error Summary

During devenv startup in pod fservice-devenv-5d97b5f989-7chq6 in namespace flexus, the GitHub integration repeatedly fails while exchanging an installation id for an access token. The pod stays running, but workspace startup remains blocked while awaiting entrypoint completion.

Root Cause

  • File: flexus_client_kit/ckit_github.py:90
  • Function: exchange_installation_id_to_token
  • Why: The code POSTs to /app/installations/{installation_id}/access_tokens with a JWT derived from EXTERNAL_GITHUB_CLIENT_ID and EXTERNAL_GITHUB_APP_PRIVATE_KEY. GitHub returns 404 Not Found, which means the installation id/app credentials do not match the target installation or the app is not installed for that environment.

Code Snippet

resp = await client.post(
    f"https://api.github.com/app/installations/{installation_id}/access_tokens",
    headers={
        "Authorization": f"Bearer {app_jwt}",
        "Accept": "application/vnd.github.v3+json"
    },
    timeout=5,
    json={"repositories": [repo_name]} if repo_name else None
)

Affected

  • Pods: fservice-devenv-5d97b5f989-7chq6
  • Namespaces: flexus
  • Occurrences: 1
Dominant language
Python
Stars
6
Forks
2
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from smallcloudai/flexus-client-kit

All issues in smallcloudai/flexus-client-kit

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.