Skip to content
Latchkey

Bitbucket "We couldn't parse your bitbucket-pipelines.yml"

This is a raw YAML syntax failure, not a schema problem. The parser could not turn the file text into a document at all - usually bad indentation, a tab, or an unbalanced quote.

What this error means

Bitbucket rejects the file with "We couldn't parse your bitbucket-pipelines.yml" and a line/column reference. Unlike a configuration error, the structure was never even understood - the YAML itself is malformed.

Bitbucket UI
We couldn't parse your bitbucket-pipelines.yml file.
mapping values are not allowed here
  in "bitbucket-pipelines.yml", line 6, column 14

Common causes

Bad indentation or a tab character

YAML requires consistent space-based indentation. A tab, or a line indented to the wrong level, breaks the parser before it can interpret keys.

Unquoted special characters or unclosed quotes

A value containing :, {, or #, or a string with a missing closing quote, makes the parser misread where a mapping or scalar ends.

How to fix it

Fix indentation and quoting at the reported line

Open the file at the line/column Bitbucket names. Replace tabs with spaces and quote values that contain special characters.

bitbucket-pipelines.yml
# wrong: tab indent + unquoted colon
pipelines:
	default:
    - step:
        script:
          - echo time: now
# right
pipelines:
  default:
    - step:
        script:
          - echo "time: now"

Lint the YAML locally before pushing

Terminal
yamllint bitbucket-pipelines.yml
# or a quick parse check
python -c "import yaml,sys; yaml.safe_load(open('bitbucket-pipelines.yml'))"

How to prevent it

  • Configure your editor to insert spaces, never tabs, in YAML.
  • Run a YAML linter in a pre-commit hook.
  • Quote any string containing :, #, {, or }.

Frequently asked questions

What causes ""couldn't parse""?
YAML requires consistent space-based indentation. A tab, or a line indented to the wrong level, breaks the parser before it can interpret keys.
How do I fix "couldn't parse"?
Open the file at the line/column Bitbucket names. Replace tabs with spaces and quote values that contain special characters.

Related guides

References

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