nautechsystems/nautilus_trader · error

LiveNodeConfig.event_store is set but LiveNode::build cannot

Error message

LiveNodeConfig.event_store is set but LiveNode::build cannot install a factory; use LiveNodeBuilder::with_event_store(...) instead

What it means

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.

Source

Thrown at crates/live/src/node/mod.rs:261

    }

    /// Creates a new [`LiveNode`] directly from a kernel name and optional configuration.
    ///
    /// This is a convenience method for creating a live node with a pre-configured
    /// kernel configuration, bypassing the builder pattern. If no config is provided,
    /// a default configuration will be used.
    ///
    /// # Errors
    ///
    /// Returns an error if kernel construction fails.
    pub fn build(name: String, config: Option<LiveNodeConfig>) -> anyhow::Result<Self> {
        let config = config.unwrap_or_default();
        validate_live_environment(config.environment())?;

        config.validate_runtime_support()?;

        if config.event_store.is_some() {
            anyhow::bail!(
                "LiveNodeConfig.event_store is set but LiveNode::build cannot install a factory; \
                 use LiveNodeBuilder::with_event_store(...) instead"
            );
        }

        let runner = AsyncRunner::new();
        runner.bind_senders();

        let kernel = NautilusKernel::new(name, config.clone())?;
        #[cfg(feature = "python")]
        if let Some(controller) = config.controller.as_ref() {
            Trader::add_controller_from_importable_config(&kernel.trader, controller)?;
        }
        #[cfg(not(feature = "python"))]
        if let Some(controller) = config.controller.as_ref() {
            anyhow::bail!(
                "LiveNodeConfig.controller for importable controller '{}' requires the python feature",
                controller.controller_path

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Switch to LiveNodeBuilder and call with_event_store(...) before build().
  2. Clear the event_store field from the config if no persistence is needed.
  3. Ensure config-file loading strips event_store when using the shortcut constructor.

Example fix

// before
let node = LiveNode::build(config)?; // config.event_store = Some(...)
// after
let node = LiveNodeBuilder::new(config)?
    .with_event_store(Box::new(MyEventStoreFactory::new(store_config)))
    .build()?;
Defensive patterns

Strategy: validation

Validate before calling

if config.event_store.is_some() { /* must use LiveNodeBuilder::with_event_store */ }

Try / catch

if let Err(e) = LiveNode::build(config) { if e.to_string().contains("with_event_store") { /* switch to builder path */ } }

Prevention

When it happens

Trigger: Calling LiveNode::build (or LiveNode::new/from_config leading to it) with a LiveNodeConfig where event_store is Some(...).

Common situations: 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.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/39c854b515ec80c2. Report an issue: GitHub.