Tekton "Pipeline X can't be Run; it has an invalid spec" in CI
Tekton validated the Pipeline spec and found an error: an invalid task graph, a missing taskRef, an undeclared workspace, or a bad result reference. The PipelineRun is Failed with reason PipelineValidationFailed.
What this error means
A PipelineRun fails with "Pipeline ci/release can't be Run; it has an invalid spec: invalid value: ...".
Tekton
Pipeline ci/release can't be Run; it has an invalid spec: invalid value: pipeline task build refers to non-existent task: spec.tasks[0].taskRefCommon causes
A task in the graph references something undefined
A pipeline task points at a taskRef, workspace, or result that does not exist, so the graph is invalid.
A dependency cycle or bad runAfter
Tasks that depend on each other in a cycle, or a runAfter naming a nonexistent task, make the DAG invalid.
How to fix it
Fix the path named in the message
- The message names a path like
spec.tasks[0].taskRef. - Correct the reference, workspace binding, or runAfter that it points to.
- Re-apply the Pipeline and re-run.
Terminal
kubectl apply --dry-run=server -f pipeline.yamlDeclare workspaces the tasks require
A pipeline task that uses a workspace must list it under the Pipeline's workspaces and map it in the task.
pipeline.yaml
spec:
workspaces:
- name: source
tasks:
- name: build
workspaces:
- name: source
workspace: sourceHow to prevent it
- Dry-run apply Pipelines in CI so invalid specs fail early.
- Keep taskRefs, workspaces, and results consistent across the graph.
- Avoid dependency cycles in runAfter and result references.
Related guides
Tekton "Results X not found" in CIFix Tekton "Results X not found" in CI - a task references a result that a previous task did not emit, so the…
Tekton "Task X failed validation" in CIFix Tekton "Task X failed validation" in CI - the Task spec is structurally invalid, so the TaskRun is reject…
Tekton "invalid input params ... missing values" in CIFix Tekton "invalid input params for task X: missing values for these params" in CI - the run did not supply…