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
- Read the missing variable names from the error message and supply each key in the variables map passed to the renderer.
- Compare the template body's placeholders against the keys of the provided vars map before rendering.
- Set the required variables in the environment/config file if they are meant to come from deployment context rather than the call site.
- 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
- Co-locate the variable contract with the template (declared var list) and validate against it.
- When renaming a placeholder, grep all call sites that build the vars map.
- Use a typed builder (serde struct with required fields) instead of a free-form HashMap where possible.
- Add a test that renders every template with its documented example variables.
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
- candidate configuration exceeds 1 MiB
- orchestration template
- worktree_branch_prefix cannot be empty
- agent profile inheritance cycle
- application config exceeds local size limit
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: ®ex::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)