{"record":{"id":"7c098cd57e92c0d9","repo":"windmill-labs/windmill","slug":"yaml-parse-error","errorCode":null,"errorMessage":"YAML parse error: {}","messagePattern":"YAML parse error: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/parsers/windmill-parser-yaml/src/lib.rs","lineNumber":920,"sourceCode":"                }\n            } else {\n                return Err(anyhow!(\n                    \"{section} dependency element: missing or invalid `name` field\"\n                ));\n            }\n        }\n    }\n\n    Ok(logs)\n}\n\npub fn add_versions_to_requirements_yaml(\n    input: &str,\n    role_versions: &HashMap<String, String>,\n    collection_versions: &HashMap<String, String>,\n) -> anyhow::Result<(String, String)> {\n    let mut docs =\n        YamlLoader::load_from_str(input).map_err(|e| anyhow!(\"YAML parse error: {}\", e))?;\n    let doc = &mut docs[0];\n\n    let mut logs = String::new();\n\n    logs.push_str(\n        &update_versions(\"roles\", doc, role_versions)\n            .map_err(|e| anyhow!(\"Error updating role versions: {e}\"))?,\n    );\n    logs.push_str(\n        &update_versions(\"collections\", doc, collection_versions)\n            .map_err(|e| anyhow!(\"Error updating collection versions: {e}\"))?,\n    );\n\n    if !logs.is_empty() {\n        logs.push_str(\"WARNING: You might want to try adding manual versions for these, otherwise there could be breaking changes on deployed scripts\\n\");\n    }\n\n    let mut out_str = String::new();","sourceCodeStart":902,"sourceCodeEnd":938,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/parsers/windmill-parser-yaml/src/lib.rs#L902-L938","documentation":"add_versions_to_requirements_yaml parses the raw requirements YAML string with YamlLoader before doing any version pinning. This error wraps any syntax error reported by the underlying yaml-rust loader — malformed indentation, bad characters, unbalanced quotes/brackets, tabs, etc. — and aborts before roles/collections are touched.","triggerScenarios":"Calling add_versions_to_requirements_yaml with input that yaml-rust cannot parse: tabs for indentation, an unclosed quote in a name, a stray `:` in a scalar, `@` at invalid positions, or truncated file content.","commonSituations":"Hand-edited requirements files with tab indentation; copy-paste introducing smart quotes or non-breaking spaces; merged-conflict markers (<<<<<<<) left in the file; truncation from a failed edit.","solutions":["Run a YAML linter (yamllint or an online parser) on the input and fix the reported line/column — the wrapped yaml-rust message includes the position.","Replace tab indentation with spaces.","Remove merge-conflict markers and smart quotes/non-ASCII whitespace.","Quote scalars containing `: ` or `#` to avoid ambiguous syntax."],"exampleFix":"# before (tab indentation)\nroles:\n\t- name: geerlingguy.docker\n# after\nroles:\n  - name: geerlingguy.docker","handlingStrategy":"try-catch","validationCode":"fn precheck_yaml(input: &str) -> Result<(), String> {\n    serde_yaml::from_str::<serde_yaml::Value>(input)\n        .map(|_| ())\n        .map_err(|e| format!(\"invalid YAML before calling API: {e}\"))\n}","typeGuard":null,"tryCatchPattern":"match pin_versions(input, &roles, &collections) {\n    Err(e) if e.to_string().starts_with(\"YAML parse error\") => {\n        eprintln!(\"Fix YAML syntax (tabs, quotes, merge markers) before retrying\\n{e}\");\n    }\n    other => other,\n}","preventionTips":["Lint with yamllint before deploying","Use spaces, never tabs, for YAML indentation","Quote scalars containing ': ' or '#'","Strip merge-conflict markers and non-ASCII whitespace from edited files"],"tags":["yaml","parse-error","ansible","syntax"],"backgroundTag":"yaml-syntax-error","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}