nautechsystems/nautilus_trader · critical · anyhow::Error

Publishers filepath is required

Error message

Publishers filepath is required

What it means

DatabentoDataClientConfigBuilder::build requires the path to a publishers.json file, which maps venue/dataset/feed combinations to gateways. If publishers_filepath was not set on the builder, build() fails with this error.

Source

Thrown at crates/adapters/databento/src/factories.rs:229

    /// Sets whether to timestamp bars on close.
    #[must_use]
    pub const fn bars_timestamp_on_close(mut self, timestamp_on_close: bool) -> Self {
        self.bars_timestamp_on_close = timestamp_on_close;
        self
    }

    /// Builds the [`DatabentoDataClientConfig`].
    ///
    /// # Errors
    ///
    /// Returns an error if required fields are missing.
    pub fn build(self) -> anyhow::Result<DatabentoDataClientConfig> {
        let api_key = self
            .api_key
            .ok_or_else(|| anyhow::anyhow!("API key is required"))?;
        let publishers_filepath = self
            .publishers_filepath
            .ok_or_else(|| anyhow::anyhow!("Publishers filepath is required"))?;

        Ok(DatabentoDataClientConfig::new(
            api_key.into_inner(),
            publishers_filepath,
            self.use_exchange_as_venue,
            self.bars_timestamp_on_close,
        ))
    }
}

#[cfg(test)]
mod tests {
    use nautilus_core::time::get_atomic_clock_realtime;
    use rstest::rstest;

    use super::*;

    #[rstest]

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Download publishers.json from Databento and pass its path via .publishers_filepath(...)
  2. Set the path explicitly in your config file so it reaches the builder
  3. Verify the configured path exists and is readable at runtime before build()
  4. Ensure container/image packaging includes publishers.json

Example fix

// before
let config = DatabentoDataClientConfig::builder().api_key(key).build()?;
// after
let config = DatabentoDataClientConfig::builder()
    .api_key(key)
    .publishers_filepath("/etc/databento/publishers.json")
    .build()?;
Defensive patterns

Strategy: validation

Validate before calling

// Rust
if !Path::new(&path).is_file() { bail!("publishers.json missing"); }

Try / catch

// Rust
Err(e) => error!("config: {e:#}"),

Prevention

When it happens

Trigger: Calling build() on DatabentoDataClientConfigBuilder without calling .publishers_filepath(...) — e.g. no publishers.json downloaded, or the config file omitted the path.

Common situations: Fresh setup where publishers.json was never fetched from Databento; config file missing the publishers_filepath key; running in a container without the file copied in; path removed during config refactor.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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