{"record":{"id":"d360036d7b53a355","repo":"nautechsystems/nautilus_trader","slug":"duplicate-run-config-id","errorCode":null,"errorMessage":"Duplicate run config ID '{}'","messagePattern":"Duplicate run config ID '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/backtest/src/node.rs","lineNumber":322,"sourceCode":"        }\n    }\n\n    Ok(engine)\n}\n\nfn validate_configs(configs: &[BacktestRunConfig]) -> anyhow::Result<()> {\n    // Kernel initialization sets a thread-local MessageBus that can only be\n    // initialized once per thread, so multiple engines cannot coexist\n    anyhow::ensure!(\n        configs.len() <= 1,\n        \"Only one run config per BacktestNode is supported \\\n         (kernel MessageBus is a thread-local singleton)\"\n    );\n\n    let mut seen_ids = AHashSet::new();\n\n    for config in configs {\n        anyhow::ensure!(\n            seen_ids.insert(config.id()),\n            \"Duplicate run config ID '{}'\",\n            config.id()\n        );\n\n        let venue_names: Vec<String> = config\n            .venues()\n            .iter()\n            .map(|v| v.name().to_string())\n            .collect();\n\n        for data_config in config.data() {\n            if let (Some(start), Some(end)) = (data_config.start_time(), data_config.end_time()) {\n                anyhow::ensure!(\n                    start <= end,\n                    \"Data config start_time ({start}) must be <= end_time ({end})\"\n                );\n            }","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/backtest/src/node.rs#L304-L340","documentation":"validate_configs found two BacktestRunConfig entries sharing the same id string; engines are keyed by config id, so duplicates would collide and the node refuses to build.","triggerScenarios":"Passing two configs whose `id()` returns the same value to `BacktestNode::new` — e.g. cloning a config template and forgetting to change its id, or building configs in a loop with a constant id.","commonSituations":"Copy-pasted config templates; loop-generated configs using a fixed name; deserialized configs from a file where ids were duplicated.","solutions":["Assign a unique id to every BacktestRunConfig (e.g. append an index or scenario name)","Check loops that build configs so the id varies per iteration","Deduplicate configs by id before constructing the node"],"exampleFix":"// before\nfor scenario in scenarios {\n    configs.push(BacktestRunConfig::new(\"run\", ...));\n}\n// after\nfor (i, scenario) in scenarios.iter().enumerate() {\n    configs.push(BacktestRunConfig::new(format!(\"run-{i}\"), ...));\n}","handlingStrategy":"validation","validationCode":"let mut seen = std::collections::HashSet::new();\nfor c in &configs { assert!(seen.insert(c.id()), \"duplicate run id: {}\", c.id()); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Generate unique ids for every config (index, scenario name, uuid)","Never reuse a template config's id without renaming","Deduplicate by id before constructing the node"],"tags":["backtest","configuration","duplicate-identifier"],"backgroundTag":"invalid-config-value","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}