nautechsystems/nautilus_trader · error

Loading position snapshots from Redis cache adapter not supp

Error message

Loading position snapshots from Redis cache adapter not supported

What it means

load_position_snapshot is another deliberately unsupported read method on the Redis cache adapter, always returning this error. Position snapshots are not persisted in a form this adapter can load back.

Source

Thrown at crates/infrastructure/src/redis/cache.rs:1605

        anyhow::bail!("Loading signals from Redis cache adapter not supported")
    }

    fn load_custom_data(&self, data_type: &DataType) -> anyhow::Result<Vec<CustomData>> {
        self.database.load_custom_data(data_type)
    }

    fn load_order_snapshot(
        &self,
        _client_order_id: &ClientOrderId,
    ) -> anyhow::Result<Option<OrderSnapshot>> {
        anyhow::bail!("Loading order snapshots from Redis cache adapter not supported")
    }

    fn load_position_snapshot(
        &self,
        _position_id: &PositionId,
    ) -> anyhow::Result<Option<PositionSnapshot>> {
        anyhow::bail!("Loading position snapshots from Redis cache adapter not supported")
    }

    fn load_quotes(&self, _instrument_id: &InstrumentId) -> anyhow::Result<Vec<QuoteTick>> {
        anyhow::bail!("Loading quote data for Redis cache adapter not supported")
    }

    fn load_trades(&self, _instrument_id: &InstrumentId) -> anyhow::Result<Vec<TradeTick>> {
        anyhow::bail!("Loading market data for Redis cache adapter not supported")
    }

    fn load_funding_rates(
        &self,
        _instrument_id: &InstrumentId,
    ) -> anyhow::Result<Vec<FundingRateUpdate>> {
        anyhow::bail!("Loading market data for Redis cache adapter not supported")
    }

    fn load_bars(&self, _instrument_id: &InstrumentId) -> anyhow::Result<Vec<Bar>> {

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Load current position state via load_position / position indexes instead of snapshots.
  2. Choose a backend adapter that implements load_position_snapshot if snapshots are essential.
  3. Catch the error and fall back to loading live position records.
  4. Document in deployment config that Redis cache does not support snapshot loads.

Example fix

// before
let snap = cache.load_position_snapshot(&position_id)?; // bails on Redis
// after
let snap = cache.load_position_snapshot(&position_id).ok().flatten();
Defensive patterns

Strategy: fallback

Validate before calling

// Python
if isinstance(cache_database, RedisCacheDatabase):
    snapshot = None  # unsupported on Redis
else:
    snapshot = cache.load_position_snapshot(position_id)

Try / catch

// Python
try:
    snapshot = cache.load_position_snapshot(position_id)
except RuntimeError as e:
    if "position snapshot" in str(e) and "not supported" in str(e):
        snapshot = None
    else:
        raise

Prevention

When it happens

Trigger: Calling cache.load_position_snapshot(position_id) (or position recovery/reporting flows that use it) with the Redis cache adapter configured.

Common situations: Restart/recovery pipelines expecting position snapshot restore from Redis; analytics scripts iterating positions via snapshots; code ported from other cache backends that implement this method.

Related errors


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