A pipeline fails with a YAML syntax error. How do you find and fix it?
Quick Answer
Invalid YAML — usually indentation (tabs vs spaces), inconsistent nesting, or unquoted special characters. Validate with a linter (yamllint) or the tool schema (kubeconform, GitHub Actions/Ansible parsers) to get the exact line.
Detailed Answer
YAML is whitespace-sensitive and forbids tabs for indentation, which trips up K8s manifests, Ansible playbooks, and GitHub Actions workflows. Run yamllint or the platform validator to pin the line, watch for unquoted values that look like booleans/numbers/times (e.g., no, 08, 1:30), and use a consistent 2-space indent. Add the lint step to CI so it fails fast in review, not at deploy.
Code Example
yamllint file.yaml kubeconform manifest.yaml
Interview Tip
Call out tabs-for-indent and unquoted special values (no/yes/08) — the two classic YAML gotchas.