windmill-labs/windmill · error

Vault Password File expects a String containing the file nam

Error message

Vault Password File expects a String containing the file name

What it means

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.

Source

Thrown at backend/parsers/windmill-parser-yaml/src/lib.rs:548

                                        ret.resources
                                            .push((arg_name.to_string(), format!("$res:{}", p)));
                                    }
                                    ArgTyp::Typ(_) => (),
                                }
                            }
                        }
                    }
                }
                Yaml::String(key) if key == "inventory" => {
                    ret.inventories.extend(parse_inventories(value)?);
                }
                Yaml::String(key) if key == "additional_inventories" => {
                    ret.additional_inventories
                        .extend(parse_additional_inventories(value)?);
                }
                Yaml::String(key) if key == "vault_password" => {
                    let Yaml::String(filename) = value else {
                        return Err(anyhow!(
                            "Vault Password File expects a String containing the file name"
                        ));
                    };
                    ret.vault_password = Some(filename.to_string());
                }
                Yaml::String(key) if key == "vault_id" => {
                    let Yaml::Array(filenames) = value else {
                        return Err(anyhow!("Vault ID field expects an array of strings in the format: `label@filename`"));
                    };

                    for f in filenames {
                        let Yaml::String(filename) = f else {
                            return Err(anyhow!("The elements of the vault_id field should be strings in the format: `label@filename`"));
                        };
                        validate_vault_id(filename)?;
                        ret.vault_id.push(filename.to_string());
                    }
                }

View on GitHub (pinned to e474e8803c)

Solutions

  1. Quote the filename: `vault_password: "myvault-pass.txt"`.
  2. Ensure the value is a single string, not a list or mapping.
  3. If the filename looks numeric, quoting is mandatory so YAML keeps it a string.

Example fix

# before
vault_password: 1234
# after
vault_password: "1234"
Defensive patterns

Strategy: type-guard

Validate before calling

fn vault_password_is_string(doc: &Yaml) -> bool {
    matches!(yaml_lookup(doc, "vault_password"), Some(Yaml::String(_)))
}

Type guard

fn is_yaml_string(v: &Yaml) -> bool { matches!(v, Yaml::String(_)) }

Try / catch

match parse_ansible_reqs(content) {
    Ok(r) => r,
    Err(e) if e.to_string().contains("Vault Password File expects a String") => {
        eprintln!("Quote the vault_password value so YAML parses it as a string");
        Err(e)
    }
    Err(e) => Err(e),
}

Prevention

When it happens

Trigger: parse_ansible_reqs encounters `vault_password:` with a non-string value, e.g. `vault_password: 123` (parsed as a number) or `vault_password:` (null).

Common situations: 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.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/1f83bcc788c07a45. Report an issue: GitHub.