nautechsystems/nautilus_trader · error
update_strategy not implemented for PostgreSQL cache adapter
Error message
update_strategy not implemented for PostgreSQL cache adapter: {strategy_id} What it means
update_strategy() in the PostgreSQL cache adapter is a stub that always fails with this message including the strategy_id. Persisting strategy state snapshots to Postgres is not implemented, identical in nature to the update_actor stub right above it.
Source
Thrown at crates/infrastructure/src/sql/cache.rs:1262
"Failed to send query index_order_clients to database message handler: {e}"
)
})
}
fn update_actor(
&self,
actor_id: &ActorId,
_state: &AHashMap<String, Bytes>,
) -> anyhow::Result<()> {
anyhow::bail!("update_actor not implemented for PostgreSQL cache adapter: {actor_id}")
}
fn update_strategy(
&self,
strategy_id: &StrategyId,
_state: &AHashMap<String, Bytes>,
) -> anyhow::Result<()> {
anyhow::bail!("update_strategy not implemented for PostgreSQL cache adapter: {strategy_id}")
}
fn update_account(&self, account: &AccountAny) -> anyhow::Result<()> {
let query = DatabaseQuery::AddAccount(account_last_event(account)?, true);
self.tx.send(query).map_err(|e| {
anyhow::anyhow!("Failed to send query add_account to database message handler: {e}")
})
}
fn update_order(&self, event: &OrderEventAny) -> anyhow::Result<()> {
let query = DatabaseQuery::UpdateOrder(event.clone());
self.tx.send(query).map_err(|e| {
anyhow::anyhow!("Failed to send query update_order to database message handler: {e}")
})
}
fn update_position(&self, position: &Position) -> anyhow::Result<()> {
let query = if position.fill_voids.is_empty() {View on GitHub (pinned to 18893faf8b)
Solutions
- Disable strategy state persistence when using the Postgres cache adapter, or keep strategy state in memory
- Upgrade nautilus_trader in case a newer release implements update_strategy for the SQL adapter
- Implement update_strategy in the adapter (mirror update_actor/AddAccount-style query flow over self.tx)
- Handle the error per-strategy at the call site so persistence gaps don't halt the node
Example fix
// before
cache.update_strategy(&strategy_id, &state)?;
// after
if let Err(e) = cache.update_strategy(&strategy_id, &state) {
log::warn!("strategy state not persisted (Postgres adapter): {e}");
} Defensive patterns
Strategy: try-catch
Validate before calling
let persist_strategy_state = !matches!(cache_database, CacheDatabase::Postgres);
Try / catch
if let Err(e) = cache.update_strategy(&strategy_id, &state) {
log::warn!("update_strategy skipped (not implemented): {e}");
} Prevention
- Disable strategy state snapshots when the cache database is Postgres
- Treat unimplemented stubs in sql/cache.rs as capability limits, not transient errors
- Handle persistence failures per-strategy so a save never aborts the trading loop
When it happens
Trigger: Calling cache.update_strategy(&strategy_id, &state) — typically a strategy checkpoint/save path — when the cache database is the PostgreSQL adapter in crates/infrastructure/src/sql/cache.rs.
Common situations: Running strategies with periodic state persistence enabled on a node using the Postgres cache; migrating from a backend that stores strategy state to Postgres and assuming the save path works; recovery flows that persist state before shutdown.
Related errors
- load_funding_rates not implemented for PostgreSQL cache adap
- update_actor not implemented for PostgreSQL cache adapter: {
- Failed to start execution intent reservation: {e}
- Failed to reserve execution intent for signer {} on chain {}
- Failed to record prepared execution intent: {e}
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/0abbcbc6ef88b091.
Report an issue: GitHub.