{"record":{"id":"1f83bcc788c07a45","repo":"windmill-labs/windmill","slug":"vault-password-file-expects-a-string-containing-th","errorCode":null,"errorMessage":"Vault Password File expects a String containing the file name","messagePattern":"Vault Password File expects a String containing the file name","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/parsers/windmill-parser-yaml/src/lib.rs","lineNumber":548,"sourceCode":"                                        ret.resources\n                                            .push((arg_name.to_string(), format!(\"$res:{}\", p)));\n                                    }\n                                    ArgTyp::Typ(_) => (),\n                                }\n                            }\n                        }\n                    }\n                }\n                Yaml::String(key) if key == \"inventory\" => {\n                    ret.inventories.extend(parse_inventories(value)?);\n                }\n                Yaml::String(key) if key == \"additional_inventories\" => {\n                    ret.additional_inventories\n                        .extend(parse_additional_inventories(value)?);\n                }\n                Yaml::String(key) if key == \"vault_password\" => {\n                    let Yaml::String(filename) = value else {\n                        return Err(anyhow!(\n                            \"Vault Password File expects a String containing the file name\"\n                        ));\n                    };\n                    ret.vault_password = Some(filename.to_string());\n                }\n                Yaml::String(key) if key == \"vault_id\" => {\n                    let Yaml::Array(filenames) = value else {\n                        return Err(anyhow!(\"Vault ID field expects an array of strings in the format: `label@filename`\"));\n                    };\n\n                    for f in filenames {\n                        let Yaml::String(filename) = f else {\n                            return Err(anyhow!(\"The elements of the vault_id field should be strings in the format: `label@filename`\"));\n                        };\n                        validate_vault_id(filename)?;\n                        ret.vault_id.push(filename.to_string());\n                    }\n                }","sourceCodeStart":530,"sourceCodeEnd":566,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/parsers/windmill-parser-yaml/src/lib.rs#L530-L566","documentation":"In parse_ansible_reqs, the `vault_password` key must be a YAML string holding the vault password file name. If the parsed value is any other YAML type (number, bool, list, hash, null), the let-else throws this error.","triggerScenarios":"parse_ansible_reqs encounters `vault_password:` with a non-string value, e.g. `vault_password: 123` (parsed as a number) or `vault_password:` (null).","commonSituations":"Quoting mistakes that turn the filename into a list, writing a numeric-looking filename unquoted so YAML parses it as an integer, or leaving the key empty.","solutions":["Quote the filename: `vault_password: \"myvault-pass.txt\"`.","Ensure the value is a single string, not a list or mapping.","If the filename looks numeric, quoting is mandatory so YAML keeps it a string."],"exampleFix":"# before\nvault_password: 1234\n# after\nvault_password: \"1234\"","handlingStrategy":"type-guard","validationCode":"fn vault_password_is_string(doc: &Yaml) -> bool {\n    matches!(yaml_lookup(doc, \"vault_password\"), Some(Yaml::String(_)))\n}","typeGuard":"fn is_yaml_string(v: &Yaml) -> bool { matches!(v, Yaml::String(_)) }","tryCatchPattern":"match parse_ansible_reqs(content) {\n    Ok(r) => r,\n    Err(e) if e.to_string().contains(\"Vault Password File expects a String\") => {\n        eprintln!(\"Quote the vault_password value so YAML parses it as a string\");\n        Err(e)\n    }\n    Err(e) => Err(e),\n}","preventionTips":["Always quote vault_password values in YAML","Never leave the key empty; omit it if unused","Beware numeric-looking filenames — they parse as ints unless quoted"],"tags":["ansible","vault","yaml","type-mismatch"],"backgroundTag":"schema-validation-failed","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}