nautechsystems/nautilus_trader · error
Unsupported operation: `replace_list` for collection '{colle
Error message
Unsupported operation: `replace_list` for collection '{collection}' What it means
replace_list_operation only supports full-list replacement for the ACCOUNTS, ORDERS, and POSITIONS collections. Any other collection passed to it hits the wildcard arm and bails with this error. It enforces that Redis list replacement is not attempted on collections stored with a different Redis structure.
Source
Thrown at crates/infrastructure/src/redis/cache.rs:1034
fn replace_list(pipe: &mut Pipeline, key: &str, value: &[u8]) {
pipe.del(key);
pipe.rpush(key, value);
}
fn replace_list_operation(
pipe: &mut Pipeline,
collection: &str,
key: &str,
value: &[Bytes],
) -> anyhow::Result<()> {
check_slice_not_empty(value, stringify!(value))?;
match collection {
ACCOUNTS | ORDERS | POSITIONS => {
replace_list(pipe, key, value[0].as_ref());
Ok(())
}
_ => anyhow::bail!("Unsupported operation: `replace_list` for collection '{collection}'"),
}
}
fn update(pipe: &mut Pipeline, collection: &str, key: &str, value: &[Bytes]) -> anyhow::Result<()> {
check_slice_not_empty(value, stringify!(value))?;
match collection {
ACCOUNTS | ORDERS | POSITIONS => {
update_list(pipe, key, value[0].as_ref());
Ok(())
}
_ => anyhow::bail!("Unsupported operation: `update` for collection '{collection}'"),
}
}
fn update_list(pipe: &mut Pipeline, key: &str, value: &[u8]) {
pipe.rpush_exists(key, value);
}View on GitHub (pinned to 18893faf8b)
Solutions
- Check the collection string passed into the drain/replace path; it must be one of ACCOUNTS, ORDERS, POSITIONS.
- Use the correct operation for the collection type (e.g. delete or set for string-backed collections instead of replace_list).
- If you need list semantics for a new collection, add a match arm in replace_list_operation with an appropriate implementation.
- Replace ad-hoc calls with the supported Cache API methods so routing matches the collection.
Example fix
// before replace_list(pipe, "SIGNALS", key, value)?; // unsupported // after replace_list(pipe, ORDERS, key, value)?; // supported collection
Defensive patterns
Strategy: try-catch
Validate before calling
const REPLACEABLE: [&str; 3] = [ACCOUNTS, ORDERS, POSITIONS];
assert!(REPLACEABLE.contains(&collection), "replace_list not supported for {collection}"); Try / catch
// Python
try:
cache.replace_list(collection, key, value)
except RuntimeError as e:
if "Unsupported operation: `replace_list`" in str(e):
log.error("Collection %s does not support list replacement", collection)
else:
raise Prevention
- Use the high-level Cache API instead of calling operation functions directly.
- Keep a map of collection -> supported operations and consult it before writes.
- Spell collection names from the constants, never as raw strings.
When it happens
Trigger: Calling replace_list (via the operation dispatcher / drain flush path) with collection set to something other than ACCOUNTS/ORDERS/POSITIONS, e.g. SIGNALS, CUSTOM_DATA, INDEX, or a typo'd collection name.
Common situations: Custom cache integrations invoking the lower-level operation functions directly with unsupported collections; refactoring that repurposed drain/flush paths for new collections; passing an index key where a collection name was expected.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- Unsupported operation: `update` for collection '{collection}
- Unsupported operation: `insert` for collection '{collection}
- Unsupported operation: `delete` for collection '{collection}
- Unsupported index operation: remove from '{index_key}'
- Unsupported operation: `read` for collection '{collection}'
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/6a83f8876da38744.
Report an issue: GitHub.