Skip to content
Latchkey

Tekton "couldn't retrieve Pipeline X: not found" in CI

The controller resolved the pipelineRef by name in the PipelineRun's namespace and found no Pipeline. The run fails before any TaskRun is created.

What this error means

A PipelineRun is marked Failed with reason CouldntGetPipeline and "couldn't retrieve Pipeline 'release': pipelines.tekton.dev 'release' not found".

Tekton
couldn't retrieve Pipeline "release": pipelines.tekton.dev "release" not found

Common causes

The Pipeline is not in the run namespace

Pipelines are namespaced. The PipelineRun was created in a namespace where the referenced Pipeline was never applied.

A stale or misspelled pipelineRef name

The pipelineRef.name does not match any applied Pipeline metadata.name in that namespace.

How to fix it

Apply the Pipeline before creating the run

  1. Run kubectl get pipeline -n <ns> to see what is present.
  2. Apply the Pipeline manifest into the target namespace.
  3. Re-create the PipelineRun so the ref now resolves.
Terminal
kubectl apply -f pipeline.yaml -n ci
kubectl get pipeline -n ci

Inline the pipelineSpec to avoid the lookup

Embedding the spec in the PipelineRun removes the by-name resolution entirely.

pipelinerun.yaml
spec:
  pipelineSpec:
    tasks:
      - name: build
        taskRef:
          name: build

How to prevent it

  • Apply Pipeline and PipelineRun into the same namespace.
  • Use a git or bundle resolver so refs are not tied to cluster state.
  • Store all Tekton definitions in git and apply them as one setup step.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →