{"record":{"id":"8b98ea195c7b79f3","repo":"cube-js/cube","slug":"cachestore-cannot-be-used-on-the-worker-node-queu-8b98ea","errorCode":null,"errorMessage":"CacheStore cannot be used on the worker node! queue_ack was used.","messagePattern":"CacheStore cannot be used on the worker node! queue_ack was used\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/cubestore/cubestore/src/cachestore/cache_rocksstore.rs","lineNumber":2052,"sourceCode":"    async fn queue_cancel(&self, _key: QueueKey) -> Result<Option<QueueCancelResponse>, CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! queue_cancel was used.\")\n    }\n\n    async fn queue_heartbeat(&self, _key: QueueKey) -> Result<(), CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! queue_heartbeat_by_id was used.\")\n    }\n\n    async fn queue_retrieve_by_path(\n        &self,\n        _path: String,\n        _allow_concurrency: u32,\n        _caller_process_id: Option<String>,\n    ) -> Result<QueueRetrieveResponse, CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! queue_retrieve_by_path was used.\")\n    }\n\n    async fn queue_ack(&self, _key: QueueKey, _result: Option<String>) -> Result<bool, CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! queue_ack was used.\")\n    }\n\n    async fn queue_result(\n        &self,\n        _key: QueueKey,\n        _external_id: Option<String>,\n    ) -> Result<Option<QueueResultResponse>, CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! queue_result was used.\")\n    }\n\n    async fn queue_result_blocking(\n        &self,\n        _key: QueueKey,\n        _timeout: u64,\n    ) -> Result<Option<QueueResultResponse>, CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! queue_result_blocking was used.\")\n    }\n","sourceCodeStart":2034,"sourceCodeEnd":2070,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cubestore/cubestore/src/cachestore/cache_rocksstore.rs#L2034-L2070","documentation":"Same family as the other CacheStore worker-node stubs: on a worker node the queue_ack implementation is a deliberate panic! because worker nodes hold only a cache store and cannot acknowledge queue messages. Reaching this code means an acknowledgment was attempted against a store that does not own the queue.","triggerScenarios":"Invoking CacheStore::queue_ack(key, result) on a worker-node store instance (cache_rocksstore.rs:2052) after processing a queue item, when the queue actually lives on the master.","commonSituations":"Misrouted queue acknowledgement in a CubeStore cluster; code that consumed a queue item via a remote client but acked via the local worker store; test harness wiring the cache-only store into queue logic.","solutions":["Send queue_ack to the master node's store (the store that issued the queue item), not the local worker store","Audit cluster configuration so only master-capable nodes implement queue ack; workers should proxy to master","Replace the cache-only CacheStore with the full implementation in any process expected to ack queue messages"],"exampleFix":"// before\nlocal_store.queue_ack(key, Some(result)).await?;\n// after\nmaster_client.queue_ack(key, Some(result)).await?;","handlingStrategy":"validation","validationCode":"if !is_master { return Err(CubeError::internal(\"queue_ack requires master node\")); }\nmaster_client.queue_ack(key, result).await?;","typeGuard":"fn supports_queue_ops(store: &dyn CacheStore) -> bool { /* true only for the full master store impl */ matches!(node_role, NodeRole::Master) }","tryCatchPattern":"// panic-based guard: wrap in catch_unwind if the call site cannot be proven\nlet ok = std::panic::catch_unwind(AssertUnwindSafe(|| master_client.queue_ack(key, result))).map_err(|_| CubeError::internal(\"queue_ack called on worker node\"))?;","preventionTips":["Ack queue items on the same node/store that issued them","Keep worker nodes free of queue-ack code paths","Use remote master clients in shared queue logic","Add integration tests covering master/worker routing"],"tags":["cubestore","rust","panic","cache-store","worker-node","queue"],"backgroundTag":"cachestore-not-usable-on-worker","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}