{"record":{"id":"39c854b515ec80c2","repo":"nautechsystems/nautilus_trader","slug":"livenodeconfig-event-store-is-set-but-livenode-bu","errorCode":null,"errorMessage":"LiveNodeConfig.event_store is set but LiveNode::build cannot install a factory; use LiveNodeBuilder::with_event_store(...) instead","messagePattern":"LiveNodeConfig\\.event_store is set but LiveNode::build cannot install a factory; use LiveNodeBuilder::with_event_store\\(\\.\\.\\.\\) instead","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/live/src/node/mod.rs","lineNumber":261,"sourceCode":"    }\n\n    /// Creates a new [`LiveNode`] directly from a kernel name and optional configuration.\n    ///\n    /// This is a convenience method for creating a live node with a pre-configured\n    /// kernel configuration, bypassing the builder pattern. If no config is provided,\n    /// a default configuration will be used.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if kernel construction fails.\n    pub fn build(name: String, config: Option<LiveNodeConfig>) -> anyhow::Result<Self> {\n        let config = config.unwrap_or_default();\n        validate_live_environment(config.environment())?;\n\n        config.validate_runtime_support()?;\n\n        if config.event_store.is_some() {\n            anyhow::bail!(\n                \"LiveNodeConfig.event_store is set but LiveNode::build cannot install a factory; \\\n                 use LiveNodeBuilder::with_event_store(...) instead\"\n            );\n        }\n\n        let runner = AsyncRunner::new();\n        runner.bind_senders();\n\n        let kernel = NautilusKernel::new(name, config.clone())?;\n        #[cfg(feature = \"python\")]\n        if let Some(controller) = config.controller.as_ref() {\n            Trader::add_controller_from_importable_config(&kernel.trader, controller)?;\n        }\n        #[cfg(not(feature = \"python\"))]\n        if let Some(controller) = config.controller.as_ref() {\n            anyhow::bail!(\n                \"LiveNodeConfig.controller for importable controller '{}' requires the python feature\",\n                controller.controller_path","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/live/src/node/mod.rs#L243-L279","documentation":"LiveNode::build is the shortcut constructor and cannot install an event store factory, so it rejects any config that sets event_store. The full builder (LiveNodeBuilder::with_event_store) must be used for event persistence.","triggerScenarios":"Calling LiveNode::build (or LiveNode::new/from_config leading to it) with a LiveNodeConfig where event_store is Some(...).","commonSituations":"Upgrading code that previously ignored event_store settings; loading a shared config file that enables an event store and passing it to the quick-build path; documentation examples that mix builder and shortcut APIs.","solutions":["Switch to LiveNodeBuilder and call with_event_store(...) before build().","Clear the event_store field from the config if no persistence is needed.","Ensure config-file loading strips event_store when using the shortcut constructor."],"exampleFix":"// before\nlet node = LiveNode::build(config)?; // config.event_store = Some(...)\n// after\nlet node = LiveNodeBuilder::new(config)?\n    .with_event_store(Box::new(MyEventStoreFactory::new(store_config)))\n    .build()?;","handlingStrategy":"validation","validationCode":"if config.event_store.is_some() { /* must use LiveNodeBuilder::with_event_store */ }","typeGuard":null,"tryCatchPattern":"if let Err(e) = LiveNode::build(config) { if e.to_string().contains(\"with_event_store\") { /* switch to builder path */ } }","preventionTips":["Use LiveNodeBuilder exclusively for nodes that need event persistence.","Sanitize configs before the shortcut LiveNode::build path.","Test every config source against the constructor actually used in production."],"tags":["rust","config-validation","event-store"],"backgroundTag":"missing-dependency","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}