pipedv1: deployment remains stuck in PENDING when deploy source preparation fails in planner

Aperta Adatta ai principianti
#7,641 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@vikash7485 ci sta già lavorando.

Dal 18/11/2026.

  • #7649 di @vikash7485 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
80/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go
Ambito
backend, ci-cd

Direzione di ricerca

Inizia in pkg/app/pipedv1/controller/planner.go a planner.Run() (righe 206-226): sia targetDSP.Get che runningDSP.Get restituiscono presto senza aggiornare doneDeploymentStatus. Confronta il ramo di errore di buildPlan vicino alla riga 242, che imposta DeploymentStatus_DEPLOYMENT_FAILURE e chiama reportDeploymentFailed. Fai in modo che il percorso di errore del recupero della sorgente faccia lo stesso, poi controlla che syncPlanners in controller.go cancelli Deploying; aggiungi un test per un Get che fallisce. Fatto quando una preparazione della sorgente fallita segnala un errore di deployment invece di rimanere PENDING.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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):

  1. Run() immediately returns err.
  2. p.doneDeploymentStatus remains at its uninitialized zero value DEPLOYMENT_PENDING.
  3. In controller.go:462, c.wg.Go only logs the error:
    if err := planner.Run(ctx); err != nil {
        logger.Error("failed to run planner", zap.Error(err))
    }
    
  4. p.reportDeploymentFailed(ctx, ...) is never called.
  5. In c.syncPlanners() (controller.go:275), p.DoneDeploymentStatus().IsCompleted() evaluates to false because status is DEPLOYMENT_PENDING. Consequently, reportApplicationDeployingStatus(ctx, c.apiClient, id, false) is never called, leaving the application permanently marked as Deploying: true.
  6. Furthermore, after plannerStaleDuration passes, c.donePlanners evicts the deployment ID, and c.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:

  1. 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).
  2. Check piped logs: error while preparing target deploy source data followed by failed to run planner.
  3. Check the deployment on the control plane / web UI: the deployment remains perpetually in PENDING state and the application remains marked as deploying.

Environment:

  • piped version: master (commit 5dc13c2), pipedv1
  • control-plane version: master
  • Others: N/A
Lingua principale
Go
Stelle
1.4k
Fork
403
Merge medio
2g 9h
PR unite (30g)
40

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pipe-cd/pipecd

Tutte le issue di pipe-cd/pipecd

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.