TaskRun with extremely large params fails to run
search cancel

TaskRun with extremely large params fails to run

book

Article ID: 401549

calendar_today

Updated On:

Products

VMware Tanzu Application Platform

Issue/Introduction

TaskRun with extremely large params fails to run with the build pod init container "place-scripts" failing with the error:

exec /usr/bin/sh: argument list too long

Environment

Tanzu Application Platform

Cause

The .spec.params.value in the particular TaskRun is too large.  This value is encoded (base64) and is passed as a string argument to the command line of the build pod init container named "place-scripts".  The long string is hitting a shell limit, hence the error.

This is currently a limitation in the upstream Tekton component and has also been reported in a Tekton github issue.

The params value size could have been unnecessarily bloated if the workload has been created by using the "kubectl apply" command, as that would include an annotation "kubectl.kubernetes.io/last-applied-configuration" in the metadata section of the workload.

Resolution

Review the workload definition yaml and confirm if it has the "kubectl.kubernetes.io/last-applied-configuration" annotation.  If so, the recommended workaround is to change how the workload is created.  Instead of using "kubectl apply" to create the workload, use the "tanzu apps" command instead to create it.  If created using the "tanzu apps" command, then the workload should not have the said annotation included, which will significantly decrease the size of the TaskRun params value.

The above is the recommended workaround, but another option for temporary workaround in existing workloads, is to null the said annotation by running "kubectl patch" on the workload to null the annotation.  See below example command:

kubectl patch workload $workloadname -n $namespace --type=merge -p '{"metadata": {"annotations": {"kubectl.kubernetes.io/last-applied-configuration": "{}"}}}'