clockworklabs/SpacetimeDB · error · DBError::Other

unexpected compressed v1 update for v2 subscribe

Error message

unexpected compressed v1 update for v2 subscribe

What it means

query_rows_from_update converts a v1 DatabaseUpdate into v2 QueryRows for the v2 websocket protocol and only handles CompressableQueryUpdate::Uncompressed. Receiving a compressed update means the v1 evaluation pipeline produced compressed row sets for a client that negotiated the v2 (binary, uncompressed) protocol. This is an internal server-side invariant violation, not a client error.

Source

Thrown at crates/core/src/subscription/module_subscription_actor.rs:260

        physical_plans.insert(hash, compiled.physical_plans);
        compiled_queries.insert(hash, plan.clone());
        plans.push(plan);
        *new_queries += 1;
    }
}

fn query_rows_from_update(
    update: ws_v1::DatabaseUpdate<ws_v1::BsatnFormat>,
    use_deletes: bool,
) -> Result<ws_v2::QueryRows, DBError> {
    let tables = update
        .tables
        .into_iter()
        .flat_map(|table_update| {
            let table_name = table_update.table_name;
            table_update.updates.into_iter().map(move |single_update| {
                let ws_v1::CompressableQueryUpdate::Uncompressed(query_update) = single_update else {
                    return Err(DBError::Other(anyhow::anyhow!(
                        "unexpected compressed v1 update for v2 subscribe"
                    )));
                };
                let rows = if use_deletes {
                    query_update.deletes
                } else {
                    query_update.inserts
                };
                Ok(ws_v2::SingleTableRows {
                    table: table_name.clone(),
                    rows,
                })
            })
        })
        .collect::<Result<Vec<_>, DBError>>()?;

    Ok(ws_v2::QueryRows {
        tables: tables.into_boxed_slice(),

View on GitHub (pinned to 9e0d92412f)

Solutions

  1. Update the SpacetimeDB server to a version where v2 clients never receive compressed updates
  2. Disable update compression in server configuration if it was enabled experimentally
  3. Report it with logs - this indicates a protocol-layer bug, not a usage mistake
Defensive patterns

Strategy: try-catch

Try / catch

match subscription_result {
    Err(DBError::Other(e)) if e.to_string().contains("unexpected compressed v1 update for v2 subscribe") => {
        // Server-side protocol bug: log context, disconnect cleanly, and report to the server operators
    }
    other => other,
}

Prevention

When it happens

Trigger: A v2 subscribe or unsubscribe with row delivery flowing through evaluate_queries while the update pipeline has compression enabled - the Compressed variant reaches a code path that only understands Uncompressed.

Common situations: Server builds or configs with update compression toggled on while v2 clients connect; experimental branches; internal protocol tests.

Related errors


AI-assisted analysis of clockworklabs/SpacetimeDB@9e0d92412f (2026-08-20). Data as JSON: /api/errors/e8550ba39246702d. Report an issue: GitHub.