Skip to content
Latchkey

Buildkite "pipeline.yml could not be parsed" (Invalid YAML) in CI

Buildkite reads your pipeline definition as YAML before running anything. If the YAML is malformed, parsing fails and the build stops with a parse error and a line number.

What this error means

The build fails at the upload step with "Failed to parse pipeline.yml" or "Invalid YAML" and a line/column pointing at the offending syntax.

buildkite
+++ Uploading pipeline
Error: Failed to parse pipeline.yml: found character that cannot start any token
  at line 7, column 3

Common causes

Tabs or bad indentation

YAML forbids tabs for indentation; a stray tab or misaligned list item makes the parser reject the file.

Unquoted special characters

A value beginning with {, [, *, : or containing a colon needs quoting; unquoted, it produces "cannot start any token" or a mapping error.

How to fix it

Lint the pipeline YAML before uploading

  1. Run a YAML linter or buildkite-agent pipeline upload --dry-run on the file.
  2. Replace tabs with spaces and quote any value with special characters.
  3. Commit the fix and re-run the build.
Terminal
buildkite-agent pipeline upload .buildkite/pipeline.yml --dry-run

Quote risky command strings

Wrap commands that contain colons or leading special characters in quotes so YAML treats them as scalars.

pipeline.yml
steps:
  - command: "echo 'deploy: starting'"
    label: ":rocket: deploy"

How to prevent it

  • Run pipeline upload --dry-run or a YAML linter in a pre-commit hook.
  • Use spaces, never tabs, for YAML indentation.
  • Quote command strings that contain colons or special characters.

Frequently asked questions

What causes ""pipeline.yml could not be parsed""?
YAML forbids tabs for indentation; a stray tab or misaligned list item makes the parser reject the file.
How do I fix "pipeline.yml could not be parsed"?
Lint the pipeline YAML before uploading

Related guides

References

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