Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Bug][Blueprint] Cron-triggered pipelines use a sanitized plan after PATCH /blueprints, gitextractor fails with masked credentials

オープン
#9,243 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
1〜2日
初心者へのやさしさ
56/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go
領域
backend, devops

調査の方向性

Read backend/server/services/blueprint.go around PatchBlueprint, saveBlueprint, and reloadBlueprint, then inspect SanitizeBlueprint and pluginOptionSanitizers in backend/server/services/pipeline.go. Trace how the cron job and API response share the blueprint plan, then review existing blueprint service tests. Done means cron runs after a PATCH use the stored credentials while the API response still masks them.

索引モデルが issue の本文から書いたものです。

説明

Search before asking
  • I had searched in the issues and found no similar issues.
What happened

After updating an advanced-mode blueprint through the API (PATCH /blueprints/:id), the next pipeline started by the cron schedule runs with a sanitized (masked) plan. Every gitextractor task fails with:

subtask Clone Git Repo ended unexpectedly
git cmd [git clone https://git:*****@<gitlab-host>/<group>/<repo>.git /tmp/gitextractorXXXX --bare] failed
remote: HTTP Basic: Access denied. ...

The token stored in the database is correct:

  • Triggering the same blueprint manually (POST /blueprints/:id/trigger) clones every repo fine.
  • After a lake restart, cron runs work again until the next PATCH.

In our case it was 1330/1330 gitextractor tasks failing in a cron run, while the same repos cloned fine in a manual run of the same plan a few hours earlier.

Root cause (v1.0.3-beta15, still present on main):

  1. PatchBlueprint → saveBlueprint → reloadBlueprint(blueprint) registers the cron job with the same pointer:
    cronManager.AddJob(blueprint.CronConfig, &BlueprintJob{blueprint}) (backend/server/services/blueprint.go).
  2. Right after saving, PatchBlueprint calls SanitizeBlueprint(blueprint) on that same object to build the API response.
  3. The gitextractor sanitizer (pluginOptionSanitizers in backend/server/services/pipeline.go) replaces the password in options["url"] with * in place.
  4. When the cron fires, BlueprintJob.Run() calls createPipelineByBlueprint(bj.Blueprint, ...), which for advanced mode uses blueprint.Plan as is. The new pipeline gets the masked URL.

TriggerBlueprint and ReloadBlueprints (at startup) load the blueprint from the DB, which is why manual runs and runs after a restart are fine. Normal-mode blueprints are not affected, because their plan is regenerated from the connections on each run.

What do you expect to happen

Cron-triggered pipelines should use the stored (unsanitized) plan, the same as manual triggers. Sanitizing the API response should not change the object the scheduler holds.

How to reproduce
  1. Create an advanced-mode blueprint with a gitextractor task whose url contains credentials (https://git:<token>@host/group/repo.git), with enable: true, isManual: false and a cron, e.g. */5 * * * *.
  2. Update it through the API, e.g. PATCH /blueprints/:id with {"cronConfig": "*/5 * * * *"} or with a new plan.
  3. Wait for the cron to fire.
  4. The gitextractor task fails with HTTP Basic: Access denied, and the pipeline's task options show the masked URL.
  5. Trigger the same blueprint with POST /blueprints/:id/trigger: it succeeds.
Anything else

Possible fixes, either of:

  • In BlueprintJob.Run(), reload the blueprint from the DB by id before creating the pipeline.
  • In PatchBlueprint (and other handlers that sanitize after saveBlueprint), sanitize a deep copy rather than the object passed to reloadBlueprint. SanitizeBlueprint writes into blueprint.Plan[i][j], and the option maps are shared.

Workaround: set the blueprint to manual and trigger it from an external scheduler with POST /blueprints/:id/trigger, or restart lake after every blueprint update.

Version

v1.0.3-beta15 (helm chart 1.0.3-beta15). Code verified unchanged on main.

Are you willing to submit PR?
  • Yes I am willing to submit a PR!
Code of Conduct
主要言語
Go
スター
3.2k
フォーク
824
平均マージ
2日 22時間
マージ済み PR(30日)
46

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/devlake のほかの issue

apache/devlake の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。