Tekton PipelineRun validation failed

PipelineRun spec failed validation checks.

Understanding Tekton

Tekton is an open-source framework for creating CI/CD systems. It provides Kubernetes-style resources for declaring CI/CD-style pipelines. Tekton allows developers to build, test, and deploy across cloud providers or on-premise systems.

Identifying the Symptom

When working with Tekton, you might encounter an error message stating: PipelineRun validation failed. This error indicates that there is an issue with the specification of your PipelineRun resource.

Common Error Message

The error message typically appears in the logs or the output of your Tekton CLI commands, and it might look something like this:

Error from server (BadRequest): error when creating "pipelinerun.yaml": admission webhook "webhook.tekton.dev" denied the request: validation failed: ...

Details About the Issue

The PipelineRun validation failed error occurs when the specification of a PipelineRun does not meet the required validation checks. This could be due to incorrect field values, missing required fields, or mismatches between the PipelineRun and the referenced Pipeline or Task definitions.

Common Causes

  • Incorrect or missing parameters in the PipelineRun spec.
  • Mismatch between the PipelineRun and the associated Pipeline or Task definitions.
  • Invalid resource references or missing resources.

Steps to Fix the Issue

To resolve the PipelineRun validation failed error, follow these steps:

Step 1: Review the Error Message

Carefully read the error message provided by Tekton. It often contains specific details about what part of the spec is invalid. This can guide you to the exact field or section that needs correction.

Step 2: Validate the PipelineRun Spec

Ensure that your PipelineRun spec adheres to the Tekton API specifications. You can refer to the Tekton PipelineRun documentation for detailed information on the required fields and their formats.

Step 3: Check Resource References

Verify that all resources referenced in your PipelineRun exist and are correctly defined. This includes checking for correct names and types of resources.

Step 4: Use Tekton CLI for Validation

Utilize the Tekton CLI to validate your PipelineRun spec before applying it. You can use commands like:

tkn pipelinerun describe

This command helps you inspect the PipelineRun and ensure all references are correct.

Step 5: Correct the Spec

Based on the findings from the above steps, correct the PipelineRun spec. Ensure all required fields are present and correctly formatted. Reapply the corrected spec using:

kubectl apply -f pipelinerun.yaml

Conclusion

By following these steps, you should be able to resolve the PipelineRun validation failed error. For further assistance, consider visiting the Tekton Community for support and additional resources.

Never debug

Tekton

manually again

Let Dr. Droid create custom investigation plans for your infrastructure.

Book Demo
Automate Debugging for
Tekton
See how Dr. Droid creates investigation plans for your infrastructure.

MORE ISSUES

Made with ❤️ in Bangalore & San Francisco 🏢

Doctor Droid