Skip to content
Latchkey

Tekton param type mismatch (array vs string) in CI

A parameter declared as array was passed a string value (or the reverse), or an array param was used where only a string substitution is valid. Tekton rejects the run because the types do not line up.

What this error means

A run fails with "invalid parameter type" or "variable type invalid ... expected array but got string" for a specific param.

Tekton
invalid input params for task build: param types don't match the user-specified type: [args]
  expected "array" but got "string"

Common causes

An array param is passed a plain string

The Task declares args as type: array, but the run passes value: "a b c" as a single string.

An array param is used in a string-only context

Referencing $(params.args) where a string is required, instead of expanding it with $(params.args[*]), is a type mismatch.

How to fix it

Pass an array param as a list

Provide the value as a YAML list matching the declared array type.

taskrun.yaml
spec:
  params:
    - name: args
      value:
        - build
        - ./...

Expand arrays correctly in the step

Use the [*] form to expand an array param into command args.

task.yaml
steps:
  - name: build
    image: golang:1.22
    command: ["go"]
    args: ["$(params.args[*])"]

How to prevent it

  • Match the passed value shape to the declared param type.
  • Use $(params.name[*]) when expanding array params into args.
  • Validate manifests so type mismatches surface before a run.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →