{"record":{"id":"4c120f5e1c5eedb4","repo":"cube-js/cube","slug":"cachestore-cannot-be-used-on-the-worker-node-queu-4c120f","errorCode":null,"errorMessage":"CacheStore cannot be used on the worker node! queue_add_and_retrieve was used.","messagePattern":"CacheStore cannot be used on the worker node! queue_add_and_retrieve was used\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/cubestore/cubestore/src/cachestore/cache_rocksstore.rs","lineNumber":2003,"sourceCode":"        &self,\n        _limit: Option<usize>,\n    ) -> Result<Vec<IdRow<QueueResult>>, CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! queue_results_all was used.\")\n    }\n\n    async fn queue_results_multi_delete(&self, _ids: Vec<u64>) -> Result<(), CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! queue_results_multi_delete was used.\")\n    }\n\n    async fn queue_add(&self, _payload: QueueAddPayload) -> Result<QueueAddResponse, CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! queue_add was used.\")\n    }\n\n    async fn queue_add_and_retrieve(\n        &self,\n        _payload: QueueAddAndRetrievePayload,\n    ) -> Result<QueueAddAndRetrieveResponse, CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! queue_add_and_retrieve was used.\")\n    }\n\n    async fn queue_clear(&self) -> Result<(), CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! queue_clear was used.\")\n    }\n\n    async fn queue_to_cancel(\n        &self,\n        _prefix: String,\n        _orphaned_timeout: Option<u32>,\n        _heartbeat_timeout: Option<u32>,\n    ) -> Result<Vec<IdRow<QueueItem>>, CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! queue_to_cancel was used.\")\n    }\n\n    async fn queue_list(\n        &self,\n        _prefix: String,","sourceCodeStart":1985,"sourceCodeEnd":2021,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cubestore/cubestore/src/cachestore/cache_rocksstore.rs#L1985-L2021","documentation":"queue_add_and_retrieve atomically enqueues work and fetches results; it is a metastore-only queue operation. CacheStore (worker node store) panics on any invocation because workers hold no queue state.","triggerScenarios":"Calling queue_add_and_retrieve (QueueAddAndRetrievePayload) against a worker node — typically from query orchestration code resolving the CubeStore connection to a worker.","commonSituations":"Multi-node deployments where pre-aggregation build requests are balanced across all nodes; miswired client connection strings after adding worker nodes.","solutions":["Route add-and-retrieve calls to the metastore node.","Review connection setup so the queue-capable client targets the metastore, not the worker pool.","Ensure the node executing this call was started with metastore storage enabled.","Add a role check before issuing queue calls in custom tooling."],"exampleFix":"// before\nlet resp = workerStore.queueAddAndRetrieve(payload).await?;\n// after\nlet resp = metastoreStore.queueAddAndRetrieve(payload).await?;","handlingStrategy":"validation","validationCode":"if !is_metastore(store.node()) {\n    return Err(CubeError::internal(\"queue_add_and_retrieve requires the metastore node\"));\n}\nlet resp = store.queueAddAndRetrieve(payload).await?;","typeGuard":"fn is_metastore(node: &CubeStoreNode) -> bool {\n    matches!(node.role(), NodeRole::Metastore)\n}","tryCatchPattern":null,"preventionTips":["Verify connection strings after scaling out workers.","Keep add-and-retrieve traffic on a dedicated metastore client instance.","Add smoke test asserting queue calls succeed at deploy time."],"tags":["cubestore","rust","topology","queue"],"backgroundTag":"wrong-node-role","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}