{"record":{"id":"1ac3ddbcc1f840b0","repo":"affaan-m/ECC","slug":"missing-orchestration-template-variable-s","errorCode":null,"errorMessage":"missing orchestration template variable(s): {}","messagePattern":"missing orchestration template variable\\(s\\): (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ecc2/src/config/mod.rs","lineNumber":878,"sourceCode":"    let mut missing = Vec::new();\n    let rendered = placeholder.replace_all(value, |captures: &regex::Captures<'_>| {\n        let key = captures\n            .get(1)\n            .map(|capture| capture.as_str())\n            .unwrap_or_default();\n        match vars.get(key) {\n            Some(value) => value.to_string(),\n            None => {\n                missing.push(key.to_string());\n                String::new()\n            }\n        }\n    });\n\n    if !missing.is_empty() {\n        missing.sort();\n        missing.dedup();\n        anyhow::bail!(\n            \"missing orchestration template variable(s): {}\",\n            missing.join(\", \")\n        );\n    }\n\n    Ok(rendered.into_owned())\n}\n\nimpl BudgetAlertThresholds {\n    pub fn sanitized(self) -> Self {\n        let values = [self.advisory, self.warning, self.critical];\n        let valid = values.into_iter().all(f64::is_finite)\n            && self.advisory > 0.0\n            && self.advisory < self.warning\n            && self.warning < self.critical\n            && self.critical < 1.0;\n\n        if valid {","sourceCodeStart":860,"sourceCodeEnd":896,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/ecc2/src/config/mod.rs#L860-L896","documentation":"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.","triggerScenarios":"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`).","commonSituations":"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.","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."],"exampleFix":"// before\nlet vars = HashMap::from([(\"project\", \"ecc\")]);\nlet rendered = render_template(&template, &vars)?; // missing: task_group\n\n// after\nlet vars = HashMap::from([\n    (\"project\", \"ecc\"),\n    (\"task_group\", \"review\"),\n]);\nlet rendered = render_template(&template, &vars)?;","handlingStrategy":"validation","validationCode":"let placeholders: HashSet<String> = extract_placeholders(&template.body);\nlet provided: HashSet<String> = vars.keys().cloned().collect();\nlet missing: Vec<_> = placeholders.difference(&provided).collect();\nif !missing.is_empty() {\n    return Err(anyhow!(\"missing vars: {}\", missing.join(\", \")));\n}","typeGuard":null,"tryCatchPattern":"match render_template(&template, &vars) {\n    Ok(r) => r,\n    Err(e) if e.to_string().starts_with(\"missing orchestration template variable\") => {\n        eprintln!(\"Provide required vars: {e}\");\n        return Err(e);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["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."],"tags":["config","templating","validation","rust"],"backgroundTag":"missing-required-argument","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}