nautechsystems/nautilus_trader · error

Unsupported operation: `update` for collection '{collection}

Error message

Unsupported operation: `update` for collection '{collection}'

What it means

update only supports the update (RPUSH-to-existing-list) operation for ACCOUNTS, ORDERS, and POSITIONS collections. Other collections fall through to the wildcard arm and bail. The function guards Redis list appends so they cannot corrupt collections stored as strings, sets, or hashes.

Source

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

    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);
}

fn delete(
    pipe: &mut Pipeline,
    collection: &str,
    key: &str,
    value: Option<Vec<Bytes>>,
) -> anyhow::Result<()> {
    log::debug!(
        "delete: collection={}, key={}, has_payload={}",
        collection,
        key,
        value.is_some()

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Verify the collection argument is exactly ACCOUNTS, ORDERS, or POSITIONS before calling update.
  2. Route other collections through their supported operations (set/delete/index APIs).
  3. Add a new match arm in update if list-append semantics are required for another collection.
  4. Check Python call sites (py_update) for swapped or wrong collection arguments.

Example fix

// before
update(pipe, "ACTORS", key, value)?; // not list-appended
// after
update(pipe, ORDERS, key, value)?;
Defensive patterns

Strategy: try-catch

Validate before calling

const UPDATABLE: [&str; 3] = [ACCOUNTS, ORDERS, POSITIONS];
assert!(UPDATABLE.contains(&collection), "update not supported for {collection}");

Try / catch

// Python
try:
    cache.update(collection, key, value)
except RuntimeError as e:
    if "Unsupported operation: `update`" in str(e):
        log.error("Cannot append-update collection %s via Redis adapter", collection)
    else:
        raise

Prevention

When it happens

Trigger: Calling update (e.g. from py_update in the Python bindings) with a collection other than ACCOUNTS/ORDERS/POSITIONS, such as passing an index key, ACTORS, STRATEGIES, or a misspelled collection name.

Common situations: Python-side cache code calling cache.update() with a collection name that is actually handled by another operation; strategies customizing serialization for a collection the adapter does not stream as a list; typos in collection constants.

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


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