cube-js/cube · error

CacheStore cannot be used on the worker node! queue_merge_ex

Error message

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

What it means

CacheStore::queue_merge_extra merges extra payload into a queue entry; on worker nodes this is a deliberate panic! stub because workers have no queue storage. The panic signals an attempt to mutate queue state through a cache-only store.

Source

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

    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.")
    }

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

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

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

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Route queue_merge_extra calls to the master node's store
  2. Verify process role at startup and skip/refuse queue mutation paths on workers
  3. Use a remote store client to the master instead of the local cache store

Example fix

// before
worker_store.queue_merge_extra(key, payload).await?;
// after
master_client.queue_merge_extra(key, payload).await?;
Defensive patterns

Strategy: validation

Validate before calling

if !is_master { return Err(CubeError::internal("queue_merge_extra requires master node")); }
master_client.queue_merge_extra(key, payload).await?;

Type guard

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

Try / catch

std::panic::catch_unwind(AssertUnwindSafe(|| master_client.queue_merge_extra(key, payload))).map_err(|_| CubeError::internal("queue_merge_extra called on worker node"))?;

Prevention

When it happens

Trigger: Calling CacheStore::queue_merge_extra(key, payload) on a worker-node CacheStore (cache_rocksstore.rs:2072).

Common situations: Queue bookkeeping code (e.g. attaching metadata to a running query queue entry) executing on a worker node; mixed-version cluster where a worker was handed queue duties.

Related errors


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