nautechsystems/nautilus_trader · error
update_actor not implemented for PostgreSQL cache adapter: {
Error message
update_actor not implemented for PostgreSQL cache adapter: {actor_id} What it means
update_actor() in the PostgreSQL cache adapter is a stub that always bails with this message including the actor_id. Persisting actor state snapshots to Postgres is unsupported, so any actor state save through this adapter fails. It is an explicit unimplemented feature, not a data or connection problem.
Source
Thrown at crates/infrastructure/src/sql/cache.rs:1254
fn index_order_clients(&self, claims: &[(ClientOrderId, ClientId)]) -> anyhow::Result<()> {
if claims.is_empty() {
return Ok(());
}
let query = DatabaseQuery::IndexOrderClients(claims.to_vec());
self.tx.send(query).map_err(|e| {
anyhow::anyhow!(
"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<()> {View on GitHub (pinned to 18893faf8b)
Solutions
- Avoid actor state persistence with the Postgres adapter (keep state in memory) or disable periodic state snapshots in the actor/node config
- Upgrade nautilus_trader in case a newer release implements update_actor for the SQL adapter
- Implement update_actor in the adapter: write the serialized state rows for actor_id as done for other entities, then send the query over self.tx
- Catch the error per-actor so one failed snapshot does not abort the whole trading loop
Example fix
// before
let state: AHashMap<String, Bytes> = actor.snapshot_state();
cache.update_actor(&actor_id, &state)?;
// after
if let Err(e) = cache.update_actor(&actor_id, &state) {
log::warn!("actor state not persisted (Postgres adapter): {e}");
} Defensive patterns
Strategy: try-catch
Validate before calling
// disable actor state persistence when using the SQL cache let persist_actor_state = !matches!(cache_database, CacheDatabase::Postgres);
Try / catch
if let Err(e) = cache.update_actor(&actor_id, &state) {
log::warn!("update_actor skipped (not implemented): {e}");
} Prevention
- Audit actor/strategy persistence features against adapter support before enabling them in config
- Keep actor state in memory when using the Postgres cache adapter
- Watch upstream releases for update_actor implementation in the SQL adapter
When it happens
Trigger: Calling cache.update_actor(&actor_id, &state) — e.g. an actor framework snapshot/checkpoint path — while the cache database is the PostgreSQL adapter in crates/infrastructure/src/sql/cache.rs.
Common situations: Enabling actor state persistence in a live or sandbox node configured with the Postgres cache; migrating nodes from a cache backend that supports actor state to Postgres; periodic state-saving logic that fires automatically for every actor.
Related errors
- load_funding_rates not implemented for PostgreSQL cache adap
- update_strategy 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/27ed24a4eb421899.
Report an issue: GitHub.