{"record":{"id":"7f85c18e1aa46116","repo":"windmill-labs/windmill","slug":"failed-to-parse-git-repo-e","errorCode":null,"errorMessage":"Failed to parse git repo: {e}","messagePattern":"Failed to parse git repo: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/parsers/windmill-parser-yaml/src/lib.rs","lineNumber":580,"sourceCode":"                        };\n                        validate_vault_id(filename)?;\n                        ret.vault_id.push(filename.to_string());\n                    }\n                }\n                Yaml::String(key) if key == \"options\" => {\n                    if let Yaml::Array(opts) = &value {\n                        ret.options = parse_ansible_options(opts);\n                    }\n                }\n                Yaml::String(key) if key == \"git_repos\" => {\n                    let Yaml::Array(repos) = &value else {\n                        return Err(anyhow!(\"git_repos field expects an array of repos\"));\n                    };\n\n                    for r in repos {\n                        ret.git_repos.push(\n                            parse_git_repo(r)\n                                .map_err(|e| anyhow!(\"Failed to parse git repo: {e}\"))?,\n                        );\n                    }\n                }\n                Yaml::String(key) if key == \"git_ssh_identity\" => {\n                    extract_ssh_identity(&value, &mut ret.git_ssh_identity)?;\n                }\n                Yaml::String(key) if key == \"delegate_to_git_repo\" => {} // Skip this because it was already parsed before\n                Yaml::String(key) => logs.push_str(&format!(\"\\nUnknown field `{}`. Ignoring\", key)),\n                _ => (),\n            }\n        }\n    }\n\n    let mut out_str = String::new();\n    let mut emitter = YamlEmitter::new(&mut out_str);\n\n    for i in 1..docs.len() {\n        emitter.dump(&docs[i])?;","sourceCodeStart":562,"sourceCodeEnd":598,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/parsers/windmill-parser-yaml/src/lib.rs#L562-L598","documentation":"Wrapper error raised by parse_ansible_reqs when one element of the `git_repos` array fails parse_git_repo. The inner error (`Should be a Map`, missing `url`, missing `target`) is re-wrapped with the prefix 'Failed to parse git repo: ' so the developer knows which list context failed. It indicates one repo entry inside the git_repos list is malformed.","triggerScenarios":"parse_ansible_reqs iterating the `git_repos` array encounters an element that is not a map, or a map lacking a string `url` or string `target` field; parse_git_repo returns Err and the map_err wraps it.","commonSituations":"A list item accidentally written as a string URL instead of a map; typos like `uurl:` or `targetPath:` instead of `url:`/`target:`; a null list entry (`-`); quoting/indentation errors turning a map into a scalar.","solutions":["Read the inner message after the prefix to see the actual cause (not a map, missing `url`, or missing `target`)","Make each list element a map with at least `url` and `target` string keys","Remove or fix null/empty entries in the git_repos list","Check indentation: `url`/`target` must be indented under the same list item"],"exampleFix":"# before\ngit_repos:\n  - https://github.com/org/repo.git\n\n# after\ngit_repos:\n  - url: https://github.com/org/repo.git\n    target: repo","handlingStrategy":"try-catch","validationCode":"fn validate_git_repos_entries(value: &Yaml) -> Result<(), String> {\n    if let Yaml::Array(repos) = value {\n        for r in repos {\n            if let Yaml::Hash(m) = r {\n                m.get(&Yaml::String(\"url\".into())).and_then(|v| v.as_str())\n                    .ok_or(\"repo missing string url\")?;\n                m.get(&Yaml::String(\"target\".into())).and_then(|v| v.as_str())\n                    .ok_or(\"repo missing string target\")?;\n            } else {\n                return Err(\"each git_repos entry must be a map\".into());\n            }\n        }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":"match parse_assets(yaml) {\n    Err(e) if e.to_string().starts_with(\"Failed to parse git repo:\") => {\n        // inspect inner cause after the prefix and fix the offending repo entry\n    }\n    other => other?,\n}","preventionTips":["Give every repo entry both `url` and `target` as strings","Never put bare URL strings in the git_repos list","Keep repo keys indented under the same list item"],"tags":["yaml","ansible","parser","git"],"backgroundTag":"yaml-schema-validation","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"}