Boneyard Tools

Common YAML errors and how to fix them

Tabs, inconsistent indentation, missing colons and other YAML mistakes, with quick fixes that make your file valid again.

Tabs for indentation

YAML forbids tab characters for indentation. Replace every leading tab with spaces, and keep the number of spaces consistent at each level.

Inconsistent indentation

All items at the same level must line up under the same column. Mixing two-space and four-space indents within a block makes the document ambiguous and invalid.

Missing space after the colon

A mapping needs a space between the colon and the value, like name: Ada. Writing name:Ada is read as a single scalar rather than a key and value.

Unquoted special characters

Values that start with characters such as @, &, * or contain a colon followed by a space often need quotes. Wrap them in single or double quotes so the parser reads them as plain text.

Frequently asked questions

Why does my YAML fail only after a certain line?

YAML errors are usually positional. The parser reads top to bottom and stops at the first line whose indentation or syntax breaks the structure, so the fix is often just above the reported line.