[Bug][GitHub] GitHub App JWT rejected when host clock is slightly ahead
Les mainteneurs répondent en général sous 2 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- Une demi-journée
- Accessibilité débutants
- 62/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- github, go
- Domaine
- authentication, backend
Piste de recherche
Start with CreateJwt on GithubAppKey in backend/plugins/github/models/connection.go, where iat and exp are set from now. The JWT change is the contained part: backdate iat by 60s and keep exp within 10 minutes, then add a unit test that checks the claims. The cron failure path (MakePlanForBlueprint and the blueprint cron runner's logging) is a separate, design-level question about recording a failed pipeline, so scope it apart from the JWT fix.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Search before asking
- I had searched in the issues and found no similar issues.
What happened
With a GitHub App connection, blueprint runs fail at plan time:
unexpected status code while getting installation access token: {"message":"'Expiration time' claim ('exp') is too far in the future","documentation_url":"https://docs.github.com/rest","status":"401"} (401)
GithubAppKey.CreateJwt in backend/plugins/github/models/connection.go sets iat = now and exp = now + 600. GitHub rejects a JWT whose exp is more than 10 minutes in the future, so any host clock even slightly ahead of GitHub's fails. Our host drifted about 1s ahead: runs failed intermittently below 1s and every time above it.
Scheduled (cron) runs fail silently. The error is raised in MakePlanForBlueprint before any pipeline is created, so no pipeline record exists: nothing shows as a failed run in the UI, and alerting on pipeline status can't catch it. The only trace is the lake log:
[blueprint] run cron job failed on blueprint:[1][Cerivo-Blueprint]
caused by: unexpected status code while getting installation access token: ... (401)
What do you expect to happen
Tolerate small clock drift, as GitHub recommends: backdate iat by 60s and keep exp under 10 minutes (e.g. iat = now - 60, exp = now + 540).
When plan generation fails for a scheduled run, record it as a failed pipeline (or otherwise surface it) instead of only logging it.
How to reproduce
- Create a GitHub App connection and a blueprint using it.
- Set the DevLake host clock about 2s ahead of real time.
- Trigger the blueprint.
Anything else
- GitHub docs: https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app
- Related:
POST /blueprints/:id/triggerreturns GitHub's 401 as its own HTTP 401. config-ui treats any 401 as an expired session and redirects to/login, which (withAUTH_ENABLEDunset) shows "Single Sign-On is not configured". That is misleading for what is an upstream GitHub error.
Version
v1.0.3-beta14 (same code on main)
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
- Langage dominant
- Go
- Étoiles
- 3.2k
- Forks
- 819
- Merge moyen
- 2 j 22 h
- PR mergées (30 j)
- 43
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Aucun guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de apache/devlake
-
[Bug][Project] Invalid metric plugin options are accepted on project save and only fail at the next pipeline runPeut-être pris @chenwei791129 l’a pris il y a 1 jour. Ouverte
Difficulté 3/5 Une demi-journée Accessibilité débutants 22/100
Les mainteneurs répondent en général sous 2 jours
-
[Bug][Dashboard] Engineering Throughput PR time panels count PRs without a project_pr_metrics row as 0 hoursPeut-être pris @chenwei791129 l’a pris il y a 1 jour. Ouverte
Difficulté 3/5 Une demi-journée Accessibilité débutants 22/100
Les mainteneurs répondent en général sous 2 jours
-
[Bug][e2e] Several plugin e2e tests fail on a fresh database because they depend on tables created by other testsPeut-être pris @chenwei791129 l’a pris il y a 1 jour. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
Les mainteneurs répondent en général sous 2 jours
-
[Feature][dora] Allow filtering which pull requests count toward Lead Time for Changes by branch namePeut-être pris @chenwei791129 l’a pris il y a 1 jour. Ouverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 15/100
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 3/5 1-2 jours Accessibilité débutants 42/100
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de apache/devlake
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
area: watch bug priority: low
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
mariadb-operator/mariadb-operator#1962 ·
Les mainteneurs répondent en général sous 1 jour
-
bug good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
eugenioenko/ttt#919 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour