nautechsystems/nautilus_trader · error · anyhow::Error

No venue found for `publisher_id` {publisher_id}

Error message

No venue found for `publisher_id` {publisher_id}

What it means

To build an InstrumentId the adapter needs a Venue. If the symbol's venue isn't cached in symbol_venue_map, it falls back to a publisher_id → Venue lookup; this error means the record's publisher_id has no registered venue mapping.

Source

Thrown at crates/adapters/databento/src/live.rs:1118

        return Ok(instrument_id);
    }

    let raw_symbol = symbol_map.get_for_rec(record).ok_or_else(|| {
        anyhow::anyhow!(
            "Cannot resolve `raw_symbol` from `symbol_map` for instrument_id {}",
            header.instrument_id
        )
    })?;

    let symbol = Symbol::from_str_unchecked(raw_symbol);

    let publisher_id = header.publisher_id;
    let venue = if let Some(venue) = symbol_venue_map.get_cloned(&symbol) {
        venue
    } else {
        let venue = publisher_venue_map
            .get(&publisher_id)
            .ok_or_else(|| anyhow::anyhow!("No venue found for `publisher_id` {publisher_id}"))?;
        *venue
    };
    let instrument_id = InstrumentId::new(symbol, venue);

    instrument_id_map.insert(header.instrument_id, instrument_id);
    Ok(instrument_id)
}

/// Handles instrument definition messages and decodes them into Nautilus instruments.
///
/// # Errors
///
/// Returns an error if instrument decoding fails.
fn handle_instrument_def_msg(
    msg: &dbn::InstrumentDefMsg,
    record: &dbn::RecordRef,
    symbol_map: &PitSymbolMap,
    publisher_venue_map: &IndexMap<PublisherId, Venue>,

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Update NautilusTrader/adapter to the latest version so the Databento publisher table includes the new publisher_id
  2. If using a historical dataset, ensure the adapter version matches the era of the data (new publishers appear over time)
  3. Seed symbol_venue_map for the affected symbols (e.g. via load_instruments with the right dataset) so the publisher lookup is bypassed
  4. Verify the record's publisher_id is sane; a garbage value indicates corrupted data

Example fix

// before
let venue = publisher_venue_map
    .get(&publisher_id)
    .ok_or_else(|| anyhow::anyhow!("No venue found for `publisher_id` {publisher_id}"))?;
// after
let venue = publisher_venue_map.get(&publisher_id).copied().unwrap_or_else(|| {
    log::warn!("Unknown publisher_id {publisher_id}, defaulting to GLBX");
    Venue::from_code("GLBX").unwrap()
});
Defensive patterns

Strategy: validation

Validate before calling

// verify publisher map coverage at startup
if publisher_venue_map.is_empty() {
    return Err(anyhow::anyhow!("publisher_venue_map empty; update adapter version"));
}

Try / catch

match result {
    Err(e) if e.to_string().contains("No venue found for `publisher_id`") => {
        log::error!("unknown publisher: {e}; upgrade adapter or seed symbol_venue_map");
    }
    other => other?,
}

Prevention

When it happens

Trigger: A record arrives with a symbol not yet seen in symbol_venue_map, and its header.publisher_id is absent from publisher_venue_map (the map built at session startup from Databento publishers).

Common situations: Databento publishes a new publisher/dataset not known to the installed adapter version, using a historical/replay file from a dataset the local publisher map doesn't cover, or a corrupted publisher_id in the record.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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