Skip to content
Latchkey

GitHub Actions matrix fail-fast cancels sibling jobs unexpectedly in CI

A matrix has fail-fast: true by default. The moment one leg fails, GitHub cancels every other in-progress leg in that matrix. That is why sibling jobs show "cancelled" even though they never failed on their own.

What this error means

One matrix leg fails and the rest immediately show "The operation was canceled" or a cancelled status, hiding which other combinations would have passed or failed.

Actions
Error: The operation was canceled.
# a sibling matrix leg failed and fail-fast cancelled this in-progress leg

Common causes

fail-fast is on by default

Without setting it, strategy.fail-fast is true, so the first failing leg cancels all other running legs in the same matrix.

You want full results across all combinations

For coverage you often want every leg to finish so you can see all failures at once, which the default prevents.

How to fix it

Disable fail-fast to run every leg

  1. Set fail-fast: false under strategy.
  2. Let all legs run to completion.
  3. Read the full matrix of results to see every failure.
.github/workflows/ci.yml
strategy:
  fail-fast: false
  matrix:
    node: [18, 20, 22]

Keep fail-fast on when speed matters

For fast feedback where any failure fails the build, leaving the default true cancels the rest and saves runner minutes.

How to prevent it

  • Set fail-fast: false when you need results from every combination.
  • Leave it default (true) when the first failure should stop the matrix.
  • Document the choice so cancelled siblings are not mistaken for bugs.

Frequently asked questions

What causes "fail-fast cancelled other legs"?
Without setting it, strategy.fail-fast is true, so the first failing leg cancels all other running legs in the same matrix.
How do I fix fail-fast cancelled other legs?
Disable fail-fast to run every leg

Related guides

References

Run this faster and cheaper on Latchkey managed runners - self-healing included. Start free → 30-day trial · No credit card