{"record":{"id":"3e9fe8a8dceaef3a","repo":"nautechsystems/nautilus_trader","slug":"loading-position-snapshots-from-redis-cache-adapte","errorCode":null,"errorMessage":"Loading position snapshots from Redis cache adapter not supported","messagePattern":"Loading position snapshots from Redis cache adapter not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/infrastructure/src/redis/cache.rs","lineNumber":1605,"sourceCode":"        anyhow::bail!(\"Loading signals from Redis cache adapter not supported\")\n    }\n\n    fn load_custom_data(&self, data_type: &DataType) -> anyhow::Result<Vec<CustomData>> {\n        self.database.load_custom_data(data_type)\n    }\n\n    fn load_order_snapshot(\n        &self,\n        _client_order_id: &ClientOrderId,\n    ) -> anyhow::Result<Option<OrderSnapshot>> {\n        anyhow::bail!(\"Loading order snapshots from Redis cache adapter not supported\")\n    }\n\n    fn load_position_snapshot(\n        &self,\n        _position_id: &PositionId,\n    ) -> anyhow::Result<Option<PositionSnapshot>> {\n        anyhow::bail!(\"Loading position snapshots from Redis cache adapter not supported\")\n    }\n\n    fn load_quotes(&self, _instrument_id: &InstrumentId) -> anyhow::Result<Vec<QuoteTick>> {\n        anyhow::bail!(\"Loading quote data for Redis cache adapter not supported\")\n    }\n\n    fn load_trades(&self, _instrument_id: &InstrumentId) -> anyhow::Result<Vec<TradeTick>> {\n        anyhow::bail!(\"Loading market data for Redis cache adapter not supported\")\n    }\n\n    fn load_funding_rates(\n        &self,\n        _instrument_id: &InstrumentId,\n    ) -> anyhow::Result<Vec<FundingRateUpdate>> {\n        anyhow::bail!(\"Loading market data for Redis cache adapter not supported\")\n    }\n\n    fn load_bars(&self, _instrument_id: &InstrumentId) -> anyhow::Result<Vec<Bar>> {","sourceCodeStart":1587,"sourceCodeEnd":1623,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/infrastructure/src/redis/cache.rs#L1587-L1623","documentation":"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.","triggerScenarios":"Calling cache.load_position_snapshot(position_id) (or position recovery/reporting flows that use it) with the Redis cache adapter configured.","commonSituations":"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.","solutions":["Load current position state via load_position / position indexes instead of snapshots.","Choose a backend adapter that implements load_position_snapshot if snapshots are essential.","Catch the error and fall back to loading live position records.","Document in deployment config that Redis cache does not support snapshot loads."],"exampleFix":"// before\nlet snap = cache.load_position_snapshot(&position_id)?; // bails on Redis\n// after\nlet snap = cache.load_position_snapshot(&position_id).ok().flatten();","handlingStrategy":"fallback","validationCode":"// Python\nif isinstance(cache_database, RedisCacheDatabase):\n    snapshot = None  # unsupported on Redis\nelse:\n    snapshot = cache.load_position_snapshot(position_id)","typeGuard":null,"tryCatchPattern":"// Python\ntry:\n    snapshot = cache.load_position_snapshot(position_id)\nexcept RuntimeError as e:\n    if \"position snapshot\" in str(e) and \"not supported\" in str(e):\n        snapshot = None\n    else:\n        raise","preventionTips":["Load live position records instead of snapshots when using Redis cache.","Isolate snapshot-restore logic behind a backend-capability check.","Test recovery flows with the exact adapter used in production."],"tags":["redis","cache","not-implemented","position-snapshot"],"backgroundTag":"method-not-implemented","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"}