--- title: "ADR 0072: Failed task log snippets come from conditions or pod logs, capped in bytes" --- * Status: accepted * Code: [`pkg/kubeinteraction/status/task_status.go`](https://github.com/tektoncd/pipelines-as-code/blob/main/pkg/kubeinteraction/status/task_status.go) ## Context `CollectFailedTasksLogSnippet` builds, per failed task, a snippet shown on the provider status. The snippet may come from the TaskRun condition message, from a waiting step message, or from the logs of failed containers. Providers limit the size of what they accept; the code sets `maxErrorSnippetCharacterLimit = 65535`, which the previous comment tied to GitHub check run output and "may apply to all other providers". ## Decision * `reasonsWithoutPodLogs` lists failure reasons where no container ran user code; the snippet then comes from the condition message and pod logs are not fetched. * `reasonsWithPodLogs` lists reasons where the pod ran; logs of every step with a non-zero exit code are fetched, and a step whose log ends with "Skipping step because a previous step failed" is ignored. * A failure reason in neither list is skipped. If the condition is false and the reason is not `FailureIgnored`, a warning is logged so a reason Tekton adds later is noticed. * The 65535 limit is applied to bytes, not characters. The log is cut to that many bytes, then trailing bytes are dropped until the string ends on a valid [UTF-8](https://issues.redhat.com/browse/UTF-8) rune. * The tests spell out the reason strings (`TaskRunValidationFailed`, `PodCreationFailed`) so the mapping from the Tekton constants to their values is pinned. ## Consequences * A later failed step overwrites the snippet of an earlier one for the same task. * The limit is a single constant shared by all providers; the code does not show whether other providers accept this size. * Status for older Tekton (embedded status, before 0.44.0) is read from the embedded field, otherwise from child references.