[Bug][GitHub] GitHub App JWT rejected when host clock is slightly ahead
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 半日
- 初心者へのやさしさ
- 62/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- github, go
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Go
- スター
- 3.2k
- フォーク
- 819
- 平均マージ
- 2日 22時間
- マージ済み PR(30日)
- 43
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/devlake のほかの issue
-
[Bug][Project] Invalid metric plugin options are accepted on project save and only fail at the next pipeline run対応中かも @chenwei791129 が 1 日前に担当しました。 オープン
難易度 3/5 半日 初心者へのやさしさ 22/100
メンテナーはふだん 2 日以内に返信
-
[Bug][Dashboard] Engineering Throughput PR time panels count PRs without a project_pr_metrics row as 0 hours対応中かも @chenwei791129 が 1 日前に担当しました。 オープン
難易度 3/5 半日 初心者へのやさしさ 22/100
メンテナーはふだん 2 日以内に返信
-
[Bug][e2e] Several plugin e2e tests fail on a fresh database because they depend on tables created by other tests対応中かも @chenwei791129 が 2 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 2 日以内に返信
-
[Feature][dora] Allow filtering which pull requests count toward Lead Time for Changes by branch name対応中かも @chenwei791129 が 1 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
メンテナーはふだん 2 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
documentation hacktoberfest priority: low skill: good first issue status: ready for dev
難易度 2/5 半日 初心者へのやさしさ 85/100
hyperledger-labs/fabric-smart-client#2142 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
numberly/vault-db-injector#107 ·
メンテナーはふだん 1 日以内に返信
-
area/import kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
[DOC] Wrong sg_egress_ports range in the Terraform Databricks Guide for AWS Hub & Spoke with Network Firewall対応中かも @akhil9tiet が今日担当しました。 オープンdocs
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
databricks/terraform-provider-databricks#6080 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信