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 foundCommon 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
- List runs with
tkn pipelinerun list -n <ns>to get the exact name. - Pass the namespace explicitly with
-n. - Use
--lastto fetch the most recent run without a name.
Terminal
tkn pipelinerun logs --last -n ci -fFetch 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 -fHow 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
Tekton step "exited with code 1" (TaskRun failed) in CIFix a Tekton TaskRun where a step exited with code 1 in CI - the container ran but the script returned a non-…
Tekton "couldn't retrieve Pipeline X: not found" in CIFix Tekton "couldn't retrieve Pipeline X: pipelines.tekton.dev not found" in CI - the PipelineRun references…
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…