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 小时
- 30 天内合并 PR
- 40
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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
维护者通常 1 天内回复
-
pipedv1: stopSignal handler panics on closed channel upon concurrent or duplicate signal calls可能重新可做 @darshpatel1052 于 11 天前认领,目前没有进行中的 PR。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 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可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复