Skip to content
Latchkey

Bitbucket "parallel" Steps - Misgrouped or Fail-Fast Cancellation

A parallel block runs its child steps concurrently - but only if they are grouped under it correctly. A misindented step runs serially, and by default one failing branch can cancel the others.

What this error means

Steps you expected to run at once run one after another, or the whole parallel group is cancelled the instant one branch fails. The config is "valid" but the grouping or fail-fast behavior is not what you intended.

bitbucket-pipelines.yml
# steps run sequentially, not in parallel - indentation is wrong
- parallel:
  - step: { script: [ ./a.sh ] }
- step: { script: [ ./b.sh ] }   # NOT inside parallel

Diagnose it: schema, branch match, or step isolation?

Bitbucket validates the pipeline file on push, and a schema error disables the pipeline rather than failing a build, which looks like nothing happened. Each step also runs in a fresh container, so nothing carries between steps unless declared.

Terminal
curl -X POST -H "Content-Type: application/x-yaml" \
  --data-binary @bitbucket-pipelines.yml \
  https://api.bitbucket.org/2.0/repositories/<workspace>/<repo>/pipelines/validate

Common causes

Child steps not nested under parallel

Every concurrent step must sit in the list directly under parallel:. A step indented one level too shallow falls out of the group and runs on its own, serially.

Fail-fast cancels sibling branches

By default, when one parallel step fails, Bitbucket can stop the remaining ones. If you wanted every branch to finish (e.g. to collect all test results), the default cancellation surprises you.

How to fix it

Nest all concurrent steps under parallel

Keep every step that should run at once inside the same parallel list.

bitbucket-pipelines.yml
- parallel:
    - step: { name: Unit, script: [ ./test.sh unit ] }
    - step: { name: Lint, script: [ ./lint.sh ] }

Control fail-fast behavior

Use the fail-fast option to keep other branches running when one fails.

bitbucket-pipelines.yml
- parallel:
    fail-fast: false
    steps:
      - step: { script: [ ./test.sh a ] }
      - step: { script: [ ./test.sh b ] }

How to prevent it

  • Double-check indentation so every concurrent step is under parallel.
  • Set fail-fast: false when you need all branches to complete.
  • Use the validator to confirm the parallel grouping you intended.

Frequently asked questions

What causes Bitbucket "parallel" steps?
There are 2 common causes: child steps not nested under parallel and fail-fast cancels sibling branches. Every concurrent step must sit in the list directly under parallel:.
How do I fix Bitbucket "parallel" steps?
There are 2 fixes depending on which cause you have: nest all concurrent steps under parallel and control fail-fast behavior. Work through them in order, since the first is the most common.
What does Bitbucket "parallel" steps actually mean?
Steps you expected to run at once run one after another, or the whole parallel group is cancelled the instant one branch fails.
How do I stop Bitbucket "parallel" steps happening again?
Double-check indentation so every concurrent step is under parallel. The prevention section lists 3 changes that keep it from recurring.

Related guides

References

Not every red build is your code. Latchkey repairs the ones that are not, on the runner. Start free → 30-day trial · No credit card