{"record":{"id":"6270a8a11b4efc49","repo":"nautechsystems/nautilus_trader","slug":"at-least-one-run-config-is-required","errorCode":null,"errorMessage":"At least one run config is required","messagePattern":"At least one run config is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/backtest/src/node.rs","lineNumber":70,"sourceCode":")]\npub struct BacktestNode {\n    configs: Vec<BacktestRunConfig>,\n    engines: AHashMap<String, BacktestEngine>,\n}\n\nimpl BacktestNode {\n    /// Creates a new [`BacktestNode`] instance.\n    ///\n    /// Validates that configs are non-empty and internally consistent:\n    /// - All data config instrument venues must have a matching venue config.\n    /// - L2/L3 book types require order book data in the data configs.\n    /// - Data config time ranges must be valid (start <= end).\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if `configs` is empty or validation fails.\n    pub fn new(configs: Vec<BacktestRunConfig>) -> anyhow::Result<Self> {\n        anyhow::ensure!(!configs.is_empty(), \"At least one run config is required\");\n        validate_configs(&configs)?;\n        Ok(Self {\n            configs,\n            engines: AHashMap::new(),\n        })\n    }\n\n    /// Returns the run configurations.\n    #[must_use]\n    pub fn configs(&self) -> &[BacktestRunConfig] {\n        &self.configs\n    }\n\n    /// Builds backtest engines from the run configurations.\n    ///\n    /// For each config, creates a [`BacktestEngine`], adds venues, and loads\n    /// instruments from the catalog. If building a config fails with\n    /// [`BacktestRunConfig::raise_exception`] disabled, logs the error and skips that config;","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/backtest/src/node.rs#L52-L88","documentation":"BacktestNode::new was called with an empty configs slice; at least one BacktestRunConfig is required to construct an engine, so node creation fails validation immediately.","triggerScenarios":"Calling `BacktestNode::new(vec![])` or passing a programmatically built, filtered, or defaulted list that ended up empty.","commonSituations":"Building configs dynamically from files/CLI/env where a filter or failed parse removed all entries; refactors that changed Vec construction semantics.","solutions":["Pass at least one valid BacktestRunConfig to BacktestNode::new","Check the code that builds the configs list for over-aggressive filtering or failed loading","Add an early guard in your app to surface the empty-config condition with your own context"],"exampleFix":"// before\nlet node = BacktestNode::new(configs)?;\n// after\nanyhow::ensure!(!configs.is_empty(), \"no backtest configs loaded\");\nlet node = BacktestNode::new(configs)?;","handlingStrategy":"validation","validationCode":"if configs.is_empty() { panic!(\"at least one BacktestRunConfig is required\"); }","typeGuard":null,"tryCatchPattern":"match BacktestNode::new(configs) {\n    Ok(node) => node,\n    Err(e) if e.to_string().contains(\"At least one run config\") => {\n        eprintln!(\"config loader produced no runs: {e}\"); std::process::exit(1);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Guard config-building code against filters that can empty the list","Load configs before constructing the node and fail with your own message"],"tags":["backtest","configuration","empty-argument"],"backgroundTag":"empty-required-field","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"}