cube-js/cube · error

CacheStore cannot be used on the worker node! queue_result w

Error message

CacheStore cannot be used on the worker node! queue_result was used.

What it means

CubeStore worker nodes implement CacheStore::queue_result as an unconditional panic! stub, because polling a queue's result is only meaningful on the node that owns the queue (the master). This error means queue_result was called on a cache-only worker store.

Source

Thrown at rust/cubestore/cubestore/src/cachestore/cache_rocksstore.rs:2060

    async fn queue_retrieve_by_path(
        &self,
        _path: String,
        _allow_concurrency: u32,
        _caller_process_id: Option<String>,
    ) -> Result<QueueRetrieveResponse, CubeError> {
        panic!("CacheStore cannot be used on the worker node! queue_retrieve_by_path was used.")
    }

    async fn queue_ack(&self, _key: QueueKey, _result: Option<String>) -> Result<bool, CubeError> {
        panic!("CacheStore cannot be used on the worker node! queue_ack was used.")
    }

    async fn queue_result(
        &self,
        _key: QueueKey,
        _external_id: Option<String>,
    ) -> Result<Option<QueueResultResponse>, CubeError> {
        panic!("CacheStore cannot be used on the worker node! queue_result was used.")
    }

    async fn queue_result_blocking(
        &self,
        _key: QueueKey,
        _timeout: u64,
    ) -> Result<Option<QueueResultResponse>, CubeError> {
        panic!("CacheStore cannot be used on the worker node! queue_result_blocking was used.")
    }

    async fn queue_merge_extra(&self, _key: QueueKey, _payload: String) -> Result<(), CubeError> {
        panic!("CacheStore cannot be used on the worker node! queue_merge_extra was used.")
    }

    async fn compaction(&self) -> Result<(), CubeError> {
        panic!("CacheStore cannot be used on the worker node! compaction was used.")
    }

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Fetch queue results from the master node via the remote store client
  2. Confirm node role configuration: worker nodes must not run result-polling paths
  3. In tests, use the full RocksDB cache store implementation rather than the worker-mode stub

Example fix

// before
let r = worker_store.queue_result(key, external_id).await?;
// after
let r = master_client.queue_result(key, external_id).await?;
Defensive patterns

Strategy: validation

Validate before calling

if !is_master { return Err(CubeError::internal("queue_result requires master node")); }
let r = master_client.queue_result(key, external_id).await?;

Type guard

fn is_queue_capable(store: &dyn CacheStore) -> bool { node_role == NodeRole::Master }

Try / catch

let r = std::panic::catch_unwind(AssertUnwindSafe(|| master_client.queue_result(key, external_id))).map_err(|_| CubeError::internal("queue_result called on worker node"))?;

Prevention

When it happens

Trigger: Calling CacheStore::queue_result(key, external_id) on a worker-node CacheStore instance (cache_rocksstore.rs:2060).

Common situations: A process running in worker mode tries to fetch queue results locally; orchestration code accidentally holds a reference to the worker cache store instead of a remote client to the master.

Related errors


AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02). Data as JSON: /api/errors/5e1a60f67ed81a1a. Report an issue: GitHub.