pipedv1: deployment remains stuck in PENDING when deploy source preparation fails in planner
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
pkg/app/pipedv1/controller/planner.go の planner.Run()(206-226行目)から始めてください。targetDSP.Get と runningDSP.Get はどちらも doneDeploymentStatus を更新せずに早期リターンします。242行目付近の buildPlan の失敗分岐と比較してください。これは DeploymentStatus_DEPLOYMENT_FAILURE を設定し、reportDeploymentFailed を呼び出します。ソース取得のエラーパスでも同じように行い、次に controller.go の syncPlanners が Deploying をクリアすることを確認してください。失敗する Get のテストを追加してください。失敗したソース準備が PENDING のままにならず、デプロイ失敗を報告したら完了です。
索引モデルが issue の本文から書いたものです。
説明
What happened:
In pipedv1, when a deployment is triggered, c.startNewPlanner() launches the planner goroutine. Inside planner.Run() (pkg/app/pipedv1/controller/planner.go:206-226), target and running deploy sources are fetched via targetDSP.Get(ctx, io.Discard) and runningDSP.Get(ctx, io.Discard).
If either Get() call fails (for example due to a git clone/fetch error, missing remote commit hash, git auth failure, or secret decryption error):
Run()immediately returnserr.p.doneDeploymentStatusremains at its uninitialized zero valueDEPLOYMENT_PENDING.- In
controller.go:462,c.wg.Goonly logs the error:if err := planner.Run(ctx); err != nil { logger.Error("failed to run planner", zap.Error(err)) } p.reportDeploymentFailed(ctx, ...)is never called.- In
c.syncPlanners()(controller.go:275),p.DoneDeploymentStatus().IsCompleted()evaluates to false because status isDEPLOYMENT_PENDING. Consequently,reportApplicationDeployingStatus(ctx, c.apiClient, id, false)is never called, leaving the application permanently marked asDeploying: true. - Furthermore, after
plannerStaleDurationpasses,c.donePlannersevicts the deployment ID, andc.deploymentLister.ListPendings()re-selects the deployment, causing the planner to repeatedly loop and fail on every sync interval.
In contrast, when buildPlan fails on line 242, it correctly reports the failure:
if err != nil {
p.doneDeploymentStatus = model.DeploymentStatus_DEPLOYMENT_FAILURE
return p.reportDeploymentFailed(ctx, fmt.Sprintf("Unable to plan the deployment (%v)", err))
}
What you expected to happen:
When deploy source retrieval fails, planner.Run() should set p.doneDeploymentStatus = model.DeploymentStatus_DEPLOYMENT_FAILURE and invoke p.reportDeploymentFailed(ctx, ...) so that the control plane records the deployment failure, alerts/notifications fire, and the application is cleared from deploying state.
How to reproduce it:
- Trigger a deployment in pipedv1 pointing to a commit hash or branch that does not exist on the remote git repository (or simulate a git authentication / decryption failure).
- Check piped logs:
error while preparing target deploy source datafollowed byfailed to run planner. - Check the deployment on the control plane / web UI: the deployment remains perpetually in
PENDINGstate and the application remains marked as deploying.
Environment:
pipedversion: master (commit 5dc13c2), pipedv1control-planeversion: master- Others: N/A
- 主要言語
- Go
- スター
- 1.4k
- フォーク
- 403
- 平均マージ
- 2日 9時間
- マージ済み PR(30日)
- 40
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pipe-cd/pipecd のほかの issue
-
kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
pipedv1 Terraform plugin fails to parse plans that invoke actions対応中かも @abhiraj75 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Add a community meetings calendar to the website対応中かも @Dhirenderchoudhary が 8 日前に担当しました。 オープンarea/docs community good first issue
難易度 2/5 半日 初心者へのやさしさ 65/100
pipe-cd/pipecd#7648 · コメント 4 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
pipe-cd/pipecd#7643 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
pipedv1: stopSignal handler panics on closed channel upon concurrent or duplicate signal calls再び着手できるかも @darshpatel1052 が 11 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
pipe-cd/pipecd#7642 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
hive
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
/v1/chat/completions logprobs leave out top_logprobs when none are requested対応中かも @Shizoqua が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
service stage:spec
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
bug(terraform): a `kubernetes_manifest` the scan can't fully read is dropped and nothing says so対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信