Skip to content
Latchkey

GitHub Actions "Matrix vector 'x' does not contain any values"

A matrix dimension expanded to no values - it is null, an empty list, or a fromJSON of an empty/blank string - so the matrix has nothing to iterate and the job cannot be generated.

What this error means

The workflow fails with "Matrix vector 'node' does not contain any values", naming a dimension whose list is empty. Common with dynamic matrices built from a previous job output.

Actions annotation
Error: Matrix vector 'node' does not contain any values

Common causes

Static dimension is empty or null

A matrix key mapped to [], null, or left blank has no values to expand, which is rejected.

Dynamic matrix produced an empty array

When the matrix comes from fromJSON(needs.x.outputs.list), an upstream job that emitted "[]" or an empty string yields a vector with no values.

How to fix it

Ensure each dimension has values

Give static dimensions a non-empty list, and guard dynamic matrices against an empty array.

.github/workflows/ci.yml
strategy:
  matrix:
    node: [18, 20, 22]   # non-empty list

Handle empty dynamic matrices

  1. Have the producing job always emit a valid non-empty JSON array, or skip the matrix job when empty.
  2. Add an if: on the matrix job that checks the upstream output is not "[]".
  3. Echo the JSON in the producer to confirm it is a non-empty array before fromJSON.

How to prevent it

  • Keep every static matrix dimension a non-empty list.
  • Guard dynamic matrices so an empty result skips rather than fails.
  • Validate producer output is valid non-empty JSON before fromJSON.

Frequently asked questions

What causes ""vector contains no values""?
A matrix key mapped to [], null, or left blank has no values to expand, which is rejected.
How do I fix "vector contains no values"?
Give static dimensions a non-empty list, and guard dynamic matrices against an empty array.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card