{"record":{"id":"6ecf14d2284e378e","repo":"affaan-m/ECC","slug":"unknown-orchestration-template-name","errorCode":null,"errorMessage":"Unknown orchestration template: {name}","messagePattern":"Unknown orchestration template: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ecc2/src/config/mod.rs","lineNumber":400,"sourceCode":"    pub fn resolve_agent_profile(&self, name: &str) -> Result<ResolvedAgentProfile> {\n        let mut chain = Vec::new();\n        self.resolve_agent_profile_inner(name, &mut chain)\n    }\n\n    pub fn harness_runner(&self, harness: &str) -> Option<&HarnessRunnerConfig> {\n        let key = harness.trim().to_ascii_lowercase();\n        self.harness_runners.get(&key)\n    }\n\n    pub fn resolve_orchestration_template(\n        &self,\n        name: &str,\n        vars: &BTreeMap<String, String>,\n    ) -> Result<ResolvedOrchestrationTemplate> {\n        let template = self\n            .orchestration_templates\n            .get(name)\n            .ok_or_else(|| anyhow::anyhow!(\"Unknown orchestration template: {name}\"))?;\n\n        if template.steps.is_empty() {\n            anyhow::bail!(\"orchestration template {name} has no steps\");\n        }\n\n        let description = interpolate_optional_string(template.description.as_deref(), vars)?;\n        let project = interpolate_optional_string(template.project.as_deref(), vars)?;\n        let task_group = interpolate_optional_string(template.task_group.as_deref(), vars)?;\n        let default_agent = interpolate_optional_string(template.agent.as_deref(), vars)?;\n        let default_profile = interpolate_optional_string(template.profile.as_deref(), vars)?;\n        if let Some(profile_name) = default_profile.as_deref() {\n            self.resolve_agent_profile(profile_name)?;\n        }\n\n        let mut steps = Vec::with_capacity(template.steps.len());\n        for (index, step) in template.steps.iter().enumerate() {\n            let task = interpolate_required_string(&step.task, vars).with_context(|| {\n                format!(","sourceCodeStart":382,"sourceCodeEnd":418,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/ecc2/src/config/mod.rs#L382-L418","documentation":"Runtime error from Config::resolve_orchestration_template in ecc2/src/config/mod.rs. The method looks up the requested template name in self.orchestration_templates; if the key is absent, it bails with \"Unknown orchestration template: {name}\". The name is interpolated as-is into the message, so a misspelled or unloaded template name is the direct cause.","triggerScenarios":"Calling resolve_orchestration_template(name, vars) with a `name` that is not a key in the loaded orchestration_templates map. This happens when a command/plan references a template that the loaded config files never defined, or when the casing of the name does not match.","commonSituations":"Typo in the template name on the CLI or in a plan file; the template is defined in a config file that was not included in the load path; the template was renamed but references were not updated; case mismatch (\"Deploy\" vs \"deploy\") since lookups are exact.","solutions":["Dump the available template names (config introspection command or by inspecting the loaded config) and copy the exact key.","Confirm the config file that defines the template is on the load path and parses without warnings.","Match casing exactly; treat template names as case-sensitive.","If the template is new, add it under the orchestration_templates section with at least one step."],"exampleFix":"// before\nlet resolved = cfg.resolve_orchestration_template(\"deploy\", &vars)?;\n\n// after\nlet name = \"deploy_prod\"; // exact key from config\nif !cfg.known_templates().contains(&name) {\n    anyhow::bail!(\"template {name} not registered; available: {:?}\", cfg.known_templates());\n}\nlet resolved = cfg.resolve_orchestration_template(name, &vars)?;","handlingStrategy":"validation","validationCode":"// Before resolving, confirm the template is registered.\nlet known: HashSet<String> = cfg.known_templates();\nif !known.contains(name) {\n    eprintln!(\"template {name} not found; available: {:?}\", known);\n    return Ok(());\n}\nlet resolved = cfg.resolve_orchestration_template(name, &vars)?;","typeGuard":"fn template_exists(cfg: &Config, name: &str) -> bool {\n    cfg.known_templates().contains(name)\n}","tryCatchPattern":"match cfg.resolve_orchestration_template(name, &vars) {\n    Ok(t) => t,\n    Err(e) if e.to_string().contains(\"Unknown orchestration template\") => {\n        eprintln!(\"tip: known templates: {:?}\", cfg.known_templates());\n        return Err(e);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Treat template names as case-sensitive and copy them exactly.","Keep a single source of truth for templates and lint references in plans.","Validate config files at load time and surface unknown references.","Run a `templates list` style introspection command before scripting."],"tags":["rust","config","validation","orchestration"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}