Timeout: missing logs
Actual Behavior
After Tekton timeout, application pods get deleted and in result the logs also disappear.

Steps to Reproduce the Problem
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: tekton-timeout
spec:
tasks:
- name: do-it
taskSpec:
steps:
- image: ubuntu
script: |
#!/usr/bin/env bash
echo "Before sleep"
sleep 36000
echo "Post sleep"
---
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: produce-timeout
labels:
framework: tekton-framework
spec:
timeouts:
pipeline: "0h0m60s"
tasks: "0h0m40s"
finally: "0h0m20s"
pipelineRef:
name: tekton-timeout
Additional Info
- Kubernetes version: 1.21
- Tekton Pipeline version: v0.35.1
I believe this is expected behaviour, and the docs should be updated to make this clear.
From the docs on TaskRun timeout:
If a TaskRun runs longer than its timeout value, the pod associated with the TaskRun will be deleted. This means that the logs of the TaskRun are not preserved.
The corresponding docs for Pipeline / PipelineRun do not mention this fact but I believe the same behaviour is expected.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/lifecycle stale
Send feedback to tektoncd/plumbing.
/remove-lifecycle stale
I need to rework : https://github.com/tektoncd/pipeline/pull/5401 in order to fix this.
Hi, Interested in this fix, otherwise it is impossible to analyze what happened before timeout. Simple reproduce pipelineRun:
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
generateName: fast-pipeline-
spec:
timeouts:
pipeline: "40s"
pipelineSpec:
tasks:
- name: sleep
taskSpec:
steps:
- name: sleep
image: bash
script: |
sleep 50
echo "after sleep 50"
sleep 10
echo "after sleep 10"
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/lifecycle stale
Send feedback to tektoncd/plumbing.
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/lifecycle rotten
Send feedback to tektoncd/plumbing.
/remove-lifecycle rotten
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/lifecycle stale
Send feedback to tektoncd/plumbing.
/lifecycle frozen