affaan-m/ECC · error

missing orchestration template variable(s)

Error message

missing orchestration template variable(s): {}

What it means

This error is raised after rendering/interpolating an orchestration template: one or more required template variables were not supplied by the caller. The missing variable names are sorted, de-duplicated, and listed comma-separated in the message. It exists to prevent templates from silently being rendered with unfilled placeholders.

Solutions

  1. Read the missing variable names from the error message and supply each key in the variables map passed to the renderer.
  2. Compare the template body's placeholders against the keys of the provided vars map before rendering.
  3. Set the required variables in the environment/config file if they are meant to come from deployment context rather than the call site.
  4. Add a pre-render validation step that extracts `{{var}}` placeholders from the template and diffs them against the provided keys.

Example fix

// before
let vars = HashMap::from([("project", "ecc")]);
let rendered = render_template(&template, &vars)?; // missing: task_group

// after
let vars = HashMap::from([
    ("project", "ecc"),
    ("task_group", "review"),
]);
let rendered = render_template(&template, &vars)?;
Defensive patterns

Strategy: validation

Validate before calling

let placeholders: HashSet<String> = extract_placeholders(&template.body);
let provided: HashSet<String> = vars.keys().cloned().collect();
let missing: Vec<_> = placeholders.difference(&provided).collect();
if !missing.is_empty() {
    return Err(anyhow!("missing vars: {}", missing.join(", ")));
}

Try / catch

match render_template(&template, &vars) {
    Ok(r) => r,
    Err(e) if e.to_string().starts_with("missing orchestration template variable") => {
        eprintln!("Provide required vars: {e}");
        return Err(e);
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Invoking orchestration-template rendering with a variables map that lacks keys the template body references (e.g. `{{project_name}}` placeholders whose corresponding entries are absent from `vars`).

Common situations: Renaming a variable in a template but not updating the call site that passes the variables; invoking a template programmatically with an incomplete HashMap; environment-specific variables (paths, project names) not exported in CI; copy-pasting a render call from another template with different variable requirements.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16). Data as JSON: /api/errors/1ac3ddbcc1f840b0. Report an issue: GitHub.

Appendix: source

Thrown at ecc2/src/config/mod.rs:878

    let mut missing = Vec::new();
    let rendered = placeholder.replace_all(value, |captures: &regex::Captures<'_>| {
        let key = captures
            .get(1)
            .map(|capture| capture.as_str())
            .unwrap_or_default();
        match vars.get(key) {
            Some(value) => value.to_string(),
            None => {
                missing.push(key.to_string());
                String::new()
            }
        }
    });

    if !missing.is_empty() {
        missing.sort();
        missing.dedup();
        anyhow::bail!(
            "missing orchestration template variable(s): {}",
            missing.join(", ")
        );
    }

    Ok(rendered.into_owned())
}

impl BudgetAlertThresholds {
    pub fn sanitized(self) -> Self {
        let values = [self.advisory, self.warning, self.critical];
        let valid = values.into_iter().all(f64::is_finite)
            && self.advisory > 0.0
            && self.advisory < self.warning
            && self.warning < self.critical
            && self.critical < 1.0;

        if valid {

View on GitHub (pinned to 8321021c54)