Skip to content

Script steps exit with code 2 before script runs on v1.6.0 #9162

@bryanbaer

Description

@bryanbaer

Summary

Script-based steps now fail immediately with exit code 2 before the user script runs when Tekton Pipelines v1.6.0 executes in our cluster. This happens even for a one-step TaskRun using BusyBox; kubectl logs (and crictl logs) show no output. The only indication of failure is the TaskRun condition message "step-say" exited with code 2: Error. The pod events show the step container being started and then killed a second later.

Steps to Reproduce

  1. Have Tekton Pipelines v1.6.0 installed (controller image gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/controller:v1.6.0@sha256:255ea8...). Our namespace is labeled with Pod Security enforce=baseline, but the failure reproduces even if we remove those labels.
  2. Apply the following TaskRun in the Tekton namespace:
apiVersion: tekton.dev/v1
kind: TaskRun
metadata:
  name: simple-echo-tr
  namespace: tekton-pipelines
spec:
  serviceAccountName: default
  taskSpec:
    steps:
      - name: say
        image: 10.34.0.202:5000/mirror/busybox:1.35
        script: |
          #!/bin/sh
          echo "hello from taskrun"
          sleep 1
  1. Wait a few seconds and inspect the pod / TaskRun status:
$ kubectl describe taskrun simple-echo-tr -n tekton-pipelines
...
  Conditions:
    Message: "step-say" exited with code 2: Error
...
  Steps:
    Name: say
    Terminated:
      Exit Code: 2
      Reason: Error
  1. kubectl logs simple-echo-tr-pod -c step-say returns nothing. crictl logs against the container ID is also empty. The /tekton/termination file in the pod is empty as well, so there is no error output to capture.

This also affects PipelineRuns: even a single-task PipelineRun that echoes "hello" fails the same way.

Expected behavior

The step script should run (printing the echo and sleeping) and succeed. This same manifest worked earlier today before we started seeing the regression.

Actual behavior

The step container exits almost immediately with exit code 2. No logs or error message are produced. The TaskRun status just reports the exit code. Because no script runs, any Task/Pipeline that uses script: steps fails before doing work.

Additional information

  • Tekton Pipelines version: v1.6.0 (controller/webhook images from the official release YAML)
  • Kubernetes version: v1.30.14 (server), containerd v2.1.5
  • Feature flags (relevant ones):
    • set-security-context: "false"
    • disable-creds-init: "false"
    • results-from: termination-message
    • running-in-environment-with-injected-sidecars: "true"
  • Namespace labels: pod-security.kubernetes.io/enforce=baseline, .../warn=restricted, .../audit=restricted
  • Container runtime shows the entrypoint command as [ "/tekton/bin/entrypoint", "-wait_file", "/tekton/downward/ready", ..., "-entrypoint", "/tekton/scripts/script-0-xxxx", "--" ] — the container exits before invoking the script.
  • We also tried disabling creds-init (setting disable-creds-init: true and restarting the controller/webhook) and re-running the TaskRun; the behavior was unchanged.

Let me know what other diagnostics would be helpful. Happy to provide the full pod YAML or run a custom entrypoint build if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/entrypointkind/bugCategorizes issue or PR as related to a bug.regressionIndicates an issue or a PR is associated to the regression in the project

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions