Skip to main content
Tekton provides debugging capabilities to help you troubleshoot failing Tasks and understand pipeline execution. This guide covers debug features and troubleshooting techniques.

Overview

Debugging features in Tekton:
  • Breakpoints on Step failure
  • Breakpoints before Step execution
  • Interactive debugging in Step containers
  • Access to debug scripts and information
  • Exit code inspection
Debug features are an alpha capability. Set enable-api-fields to "alpha" in the feature-flags ConfigMap to enable debugging.

Enabling Debug Mode

Enable debug features in your Tekton installation:
Set enable-api-fields: "alpha":

Breakpoint on Failure

Pause Task execution when a Step fails, allowing you to inspect the container state:

How Failure Breakpoints Work

  1. Step executes and fails (non-zero exit code)
  2. Instead of stopping, the Step container pauses
  3. Subsequent Steps are not skipped
  4. Step waits for user intervention
  5. User can inspect the container and decide how to continue

Accessing the Paused Step

When a Step is paused on failure:
You’ll see output like:

Interacting with the Paused Step

1

Exec into the container

2

Inspect the environment

3

Fix and continue or mark as failed

Option 1: Mark as successful and continue
Option 2: Mark as failed and continue

Debug Scripts on Failure

Example:

Breakpoint Before Step

Pause execution before a Step starts:

Accessing Before-Step Breakpoint

When the breakpoint is hit:
Output:

Before-Step Debug Options

1

Exec into the container

2

Inspect or prepare the environment

3

Continue or skip the step

Option 1: Continue with step execution
Option 2: Skip step and mark as failed

Before-Step Debug Scripts

Debug Environment

Tekton provides additional resources in debug mode:

Debug Mounts

Debug Scripts Reference

OnFailure Breakpoint:
  • /tekton/debug/scripts/debug-continue - Exit with success (creates /tekton/run/<step>/out.breakpointexit)
  • /tekton/debug/scripts/debug-fail-continue - Exit with failure (creates /tekton/run/<step>/out.breakpointexit.err)
BeforeStep Breakpoint:
  • /tekton/debug/scripts/debug-beforestep-continue - Proceed with Step execution
  • /tekton/debug/scripts/debug-beforestep-fail-continue - Skip Step and mark as failed

Step Information

Each Step has debug information available:

Viewing Logs and Status

Get TaskRun Status

View Step Logs

Using Tekton CLI

Troubleshooting Common Issues

Image Pull Errors

Symptoms:
Solutions:
  1. Verify image exists:
  1. Check image pull secrets:
  1. Verify ServiceAccount:
  1. Check credentials:

Workspace Issues

Symptoms:
Debug steps:
Common fixes:
  1. Verify workspace is provided:
  1. Check PVC exists:
  1. Fix permissions with initContainer or fsGroup:

Result Errors

Symptoms:
Debug:
Fixes:
  1. Ensure result is written:
  1. Use -n flag with echo (no trailing newline):
  1. Verify result size (must be < 4KB):

Authentication Issues

Check credentials are mounted:
Verify Secret annotation:
Should have annotation like:
Check ServiceAccount:
See the Authentication guide for detailed configuration.

Best Practices

Use Breakpoints Sparingly

Breakpoints pause TaskRun execution indefinitely. Use them for development and troubleshooting, not in production pipelines.

Add Debug Steps for Complex Tasks

Capture Artifacts on Failure

Document Expected Behavior

Add a debug Step at the beginning of complex Tasks to validate assumptions and display the execution environment.