Skip to content
Latchkey

Tekton "tkn pipelinerun logs ... not found" in CI

The tkn CLI queried for a PipelineRun by name and the API returned not found. Either the name or namespace is wrong, or the run was pruned before the log command ran.

What this error means

A CI step calling tkn pipelinerun logs <name> fails with "pipelineruns.tekton.dev \"<name>\" not found" and a non-zero exit.

Tekton
Error: pipelineruns.tekton.dev "release-run" not found

Common causes

Wrong namespace or run name

tkn defaults to the current context namespace; if the run is elsewhere, or the name is generated, the lookup fails.

The run was pruned before logs were fetched

A pruner or TTL deleted the completed PipelineRun before the log step ran, so it no longer exists.

How to fix it

Target the right run and namespace

  1. List runs with tkn pipelinerun list -n <ns> to get the exact name.
  2. Pass the namespace explicitly with -n.
  3. Use --last to fetch the most recent run without a name.
Terminal
tkn pipelinerun logs --last -n ci -f

Fetch logs before pruning removes the run

Capture the created run name and stream logs immediately, or raise the pruner TTL so runs persist long enough.

Terminal
PR=$(tkn pipeline start release -n ci --output name)
tkn pipelinerun logs "${PR##*/}" -n ci -f

How to prevent it

  • Pass the namespace explicitly to tkn in CI.
  • Capture the created run name and stream logs right away.
  • Set the PipelineRun pruner TTL long enough to fetch logs.

Related guides

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