[Bug][GitHub] GitHub App JWT rejected when host clock is slightly ahead
Maintainer antworten meist innerhalb von 2 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- Ein halber Tag
- Anfängerfreundlichkeit
- 62/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- github, go
- Bereich
- authentication, backend
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- Go
- Sterne
- 3.2k
- Forks
- 819
- Ø Merge
- 2 T. 22 Std.
- Gemergte PRs (30 T.)
- 43
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus apache/devlake
-
[Bug][Project] Invalid metric plugin options are accepted on project save and only fail at the next pipeline runEvtl. vergeben @chenwei791129 hat das vor 1 Tag übernommen. Offen
Schwierigkeit 3/5 Ein halber Tag Anfängerfreundlichkeit 22/100
Maintainer antworten meist innerhalb von 2 Tagen
-
[Bug][Dashboard] Engineering Throughput PR time panels count PRs without a project_pr_metrics row as 0 hoursEvtl. vergeben @chenwei791129 hat das vor 1 Tag übernommen. Offen
Schwierigkeit 3/5 Ein halber Tag Anfängerfreundlichkeit 22/100
Maintainer antworten meist innerhalb von 2 Tagen
-
[Bug][e2e] Several plugin e2e tests fail on a fresh database because they depend on tables created by other testsEvtl. vergeben @chenwei791129 hat das vor 2 Tagen übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
Maintainer antworten meist innerhalb von 2 Tagen
-
[Feature][dora] Allow filtering which pull requests count toward Lead Time for Changes by branch nameEvtl. vergeben @chenwei791129 hat das vor 1 Tag übernommen. Offen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 15/100
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 42/100
Maintainer antworten meist innerhalb von 2 Tagen
Ähnliche Issues
-
documentation hacktoberfest priority: low skill: good first issue status: ready for dev
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 85/100
hyperledger-labs/fabric-smart-client#2142 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
numberly/vault-db-injector#107 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area/import kind/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
-
[DOC] Wrong sg_egress_ports range in the Terraform Databricks Guide for AWS Hub & Spoke with Network FirewallEvtl. vergeben @akhil9tiet hat das heute übernommen. Offendocs
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
databricks/terraform-provider-databricks#6080 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 3 Tagen
-
spqr-coordinator usage shows 'run --config', but 'run' is not a subcommand (unknown command "run")Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
pg-sharding/spqr#3092 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag