tektoncd / pipeline

A cloud-native Pipeline resource.
https://tekton.dev
Apache License 2.0
8.36k stars 1.76k forks source link

Controller crashes for certain Pipeline after upgrade #8086

Closed khrm closed 1 day ago

khrm commented 4 days ago

Expected Behavior

Validation should either fail or pass. There shouldn't be a panic.

Actual Behavior

Controller crashes.

Steps to Reproduce the Problem

  1. Install v0.47 Pipeline
  2. Install Pipeline and Task from here: https://gist.githubusercontent.com/khrm/33b8022e6d6cc87d1f3300b117995193/raw/f8548f4deaa84f0dc718e238cb7842f888be1665/gistfile0.txt
  3. Upgrade to v0.53 Pipeline
  4. Run PipelineRun from here: https://gist.githubusercontent.com/khrm/33b8022e6d6cc87d1f3300b117995193/raw/f8548f4deaa84f0dc718e238cb7842f888be1665/gistfile0.txt

Additional Info

2024-06-28T15:47:20.228928232Z panic: runtime error: index out of range [1] with length 1
2024-06-28T15:47:20.228928232Z 
2024-06-28T15:47:20.228928232Z goroutine 216 [running]:
2024-06-28T15:47:20.228956693Z github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.validateMatrixedPipelineTaskConsumed({0xc008c50cc0?, 0x2, 0x294fd6e?}, 0x5?)
2024-06-28T15:47:20.228970432Z  /go/src/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/pipeline_validation.go:813 +0x3b8
2024-06-28T15:47:20.228970432Z github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.findAndValidateResultRefsForMatrix({0xc007f1ec00?, 0x12, 0x0?}, 0x4e13f6bc00000000?)
2024-06-28T15:47:20.229001048Z  /go/src/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/pipeline_validation.go:795 +0x292
2024-06-28T15:47:20.229001048Z github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.validateTaskResultsFromMatrixedPipelineTasksConsumed({0xc007f1ec00, 0x12, 0x13})
2024-06-28T15:47:20.229023233Z  /go/src/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/pipeline_validation.go:831 +0x189
2024-06-28T15:47:20.229023233Z github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.validateMatrix({0x2d38580, 0xc0067652f0}, {0xc007f1ec00?, 0x12, 0x13})
2024-06-28T15:47:20.229058360Z  /go/src/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/pipeline_validation.go:783 +0x137
2024-06-28T15:47:20.229058360Z github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.(*PipelineSpec).Validate(0xc002db8aa0, {0x2d38580, 0xc0067652f0})
2024-06-28T15:47:20.229074818Z  /go/src/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/pipeline_validation.go:88 +0x69b
2024-06-28T15:47:20.229087082Z github.com/tektoncd/pipeline/pkg/reconciler/pipelinerun.(*Reconciler).reconcile(0xc0009907e0, {0x2d38580, 0xc006765260}, 0xc001392000, 0x0?, 0xc00667f490)
2024-06-28T15:47:20.229111017Z  /go/src/github.com/tektoncd/pipeline/pkg/reconciler/pipelinerun/pipelinerun.go:463 +0xd7b
2024-06-28T15:47:20.229123006Z github.com/tektoncd/pipeline/pkg/reconciler/pipelinerun.(*Reconciler).ReconcileKind(0xc0009907e0, {0x2d38580, 0xc0067650e0}, 0xc001392000)
2024-06-28T15:47:20.229146874Z  /go/src/github.com/tektoncd/pipeline/pkg/reconciler/pipelinerun/pipelinerun.go:264 +0x114b
2024-06-28T15:47:20.229158835Z github.com/tektoncd/pipeline/pkg/client/injection/reconciler/pipeline/v1/pipelinerun.(*reconcilerImpl).Reconcile(0xc00077cfa0, {0x2d38580, 0xc006765020}, {0xc00675f560, 0x53})
2024-06-28T15:47:20.229181513Z  /go/src/github.com/tektoncd/pipeline/pkg/client/injection/reconciler/pipeline/v1/pipelinerun/reconciler.go:236 +0x542
2024-06-28T15:47:20.229193825Z knative.dev/pkg/controller.(*Impl).processNextWorkItem(0xc000513500)
2024-06-28T15:47:20.229193825Z  /go/src/github.com/tektoncd/pipeline/vendor/knative.dev/pkg/controller/controller.go:542 +0x4cd
2024-06-28T15:47:20.229206315Z knative.dev/pkg/controller.(*Impl).RunContext.func3()
2024-06-28T15:47:20.229206315Z  /go/src/github.com/tektoncd/pipeline/vendor/knative.dev/pkg/controller/controller.go:491 +0x68
2024-06-28T15:47:20.229218796Z created by knative.dev/pkg/controller.(*Impl).RunContext
2024-06-28T15:47:20.229218796Z  /go/src/github.com/tektoncd/pipeline/vendor/knative.dev/pkg/controller/controller.go:489 +0x354
khrm commented 4 days ago

/assign @khrm