pipeline icon indicating copy to clipboard operation
pipeline copied to clipboard

Timeout: missing logs

Open wilstdu opened this issue 3 years ago • 1 comments

Actual Behavior

After Tekton timeout, application pods get deleted and in result the logs also disappear. image

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

wilstdu avatar Aug 02 '22 07:08 wilstdu

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.

AlanGreene avatar Aug 03 '22 13:08 AlanGreene

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.

tekton-robot avatar Nov 01 '22 14:11 tekton-robot

/remove-lifecycle stale

I need to rework : https://github.com/tektoncd/pipeline/pull/5401 in order to fix this.

vdemeester avatar Nov 03 '22 15:11 vdemeester

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"

marniks7 avatar Dec 13 '22 20:12 marniks7

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.

tekton-robot avatar Mar 13 '23 20:03 tekton-robot

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.

tekton-robot avatar Apr 12 '23 20:04 tekton-robot

/remove-lifecycle rotten

AlanGreene avatar Apr 12 '23 22:04 AlanGreene

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.

tekton-robot avatar Jul 11 '23 23:07 tekton-robot

/lifecycle frozen

AlanGreene avatar Jul 12 '23 09:07 AlanGreene