clockworklabs/SpacetimeDB · error · DBError::Other

Client not found: {client_id:?}

Error message

Client not found: {client_id:?}

What it means

Error "Client not found: {client_id:?}" thrown in clockworklabs/SpacetimeDB.

Source

Thrown at crates/core/src/subscription/module_subscription_manager.rs:847

        for id in self.clients.keys().copied().collect::<Vec<_>>() {
            if let Some(client) = self.clients.get(&id)
                && client.dropped.load(Ordering::Relaxed)
            {
                self.remove_all_subscriptions(&id);
            }
        }
    }

    /// Remove a single subscription for a client.
    /// This will return an error if the client does not have a subscription with the given query id.
    pub fn remove_subscription(&mut self, client_id: ClientId, query_id: ClientQueryId) -> Result<Vec<Query>, DBError> {
        let subscription_id = (client_id, query_id);
        let Some(ci) = self
            .clients
            .get_mut(&client_id)
            .filter(|ci| !ci.dropped.load(Ordering::Acquire))
        else {
            return Err(anyhow::anyhow!("Client not found: {client_id:?}").into());
        };

        #[cfg(test)]
        ci.assert_ref_count_consistency();

        let Some(query_hashes) = ci.v1_subscriptions.remove(&subscription_id) else {
            return Err(anyhow::anyhow!("Subscription not found: {subscription_id:?}").into());
        };
        let mut queries_to_return = Vec::new();
        for hash in query_hashes {
            let remaining_refs = {
                let Some(count) = ci.subscription_ref_count.get_mut(&hash) else {
                    return Err(anyhow::anyhow!("Query count not found for query hash: {hash:?}").into());
                };
                *count -= 1;
                *count
            };
            if remaining_refs > 0 {

View on GitHub (pinned to 524b4487d9)

When it happens

Trigger: Thrown at crates/core/src/subscription/module_subscription_manager.rs:847 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of clockworklabs/SpacetimeDB@524b4487d9 (2026-08-16). Data as JSON: /api/errors/b0e3eff117e486b9. Report an issue: GitHub.