You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a PipelineRun lacks references (possibly TaskRun), it can cause the tekton-pipelines-controller pod to crash due to a runtime panic triggered by accessing a non-existing element in an array.
Expected Behavior
Controller should handle missing references gracefully, without crashing.
Actual Behavior
Pod crashes with following logs:
panic: runtime error: index out of range [0] with length 0
goroutine 382 [running]:
github.com/tektoncd/pipeline/pkg/reconciler/pipelinerun/resources.CheckMissingResultReferences({0xc03072cd00, 0xf, 0x44775a0?}, {0xc037fdfe30, 0x2, 0x0?})
/go/src/github.com/tektoncd/pipeline/pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go:801 +0x27b
github.com/tektoncd/pipeline/pkg/reconciler/pipelinerun.(*Reconciler).runNextSchedulableTask(0xc0007ec240, {0x2ce3ce8, 0xc056ddfa10}, 0xc056de8480, 0xc048d0ed08)
/go/src/github.com/tektoncd/pipeline/pkg/reconciler/pipelinerun/pipelinerun.go:841 +0x329
github.com/tektoncd/pipeline/pkg/reconciler/pipelinerun.(*Reconciler).reconcile(0xc0007ec240, {0x2ce3ce8, 0xc056ddf980}, 0xc056de8480, 0x44775a0?, 0xc056116a80)
/go/src/github.com/tektoncd/pipeline/pkg/reconciler/pipelinerun/pipelinerun.go:773 +0x4775
github.com/tektoncd/pipeline/pkg/reconciler/pipelinerun.(*Reconciler).ReconcileKind(0xc0007ec240, {0x2ce3ce8, 0xc056ddf650}, 0xc056de8480)
/go/src/github.com/tektoncd/pipeline/pkg/reconciler/pipelinerun/pipelinerun.go:265 +0x1132
github.com/tektoncd/pipeline/pkg/client/injection/reconciler/pipeline/v1/pipelinerun.(*reconcilerImpl).Reconcile(0xc000756640, {0x2ce3ce8, 0xc056ddf560}, {0xc0514bf180, 0x45})
/go/src/github.com/tektoncd/pipeline/pkg/client/injection/reconciler/pipeline/v1/pipelinerun/reconciler.go:236 +0x53b
knative.dev/pkg/controller.(*Impl).processNextWorkItem(0xc000751e60)
/go/src/github.com/tektoncd/pipeline/vendor/knative.dev/pkg/controller/controller.go:542 +0x4ad
knative.dev/pkg/controller.(*Impl).RunContext.func3()
/go/src/github.com/tektoncd/pipeline/vendor/knative.dev/pkg/controller/controller.go:491 +0x59
created by knative.dev/pkg/controller.(*Impl).RunContext in goroutine 234
/go/src/github.com/tektoncd/pipeline/vendor/knative.dev/pkg/controller/controller.go:489 +0x349
Steps to Reproduce the Problem
Create PipelineRun without task runs (have not yet confirmed)
Observe a crash in tekton-pipelines-controller related to index out of range error
Additional Info
Issue appears to be in the these lines of CheckMissingResultReferences, which assumes there will be at least one reference to each.
When a PipelineRun lacks references (possibly TaskRun), it can cause the
tekton-pipelines-controller
pod to crash due to a runtime panic triggered by accessing a non-existing element in an array.Expected Behavior
Controller should handle missing references gracefully, without crashing.
Actual Behavior
Pod crashes with following logs:
Steps to Reproduce the Problem
Additional Info
Issue appears to be in the these lines of CheckMissingResultReferences, which assumes there will be at least one reference to each.
A basic length check may be needed either, though notably the former is first checked for a CustomRun reference and might be skipped over if empty.
Related to https://issues.redhat.com/browse/SRVKP-5770
The text was updated successfully, but these errors were encountered: