{"record":{"id":"5367a6ed879a9288","repo":"cube-js/cube","slug":"cachestore-cannot-be-used-on-the-worker-node-queu-5367a6","errorCode":null,"errorMessage":"CacheStore cannot be used on the worker node! queue_results_all was used.","messagePattern":"CacheStore cannot be used on the worker node! queue_results_all was used\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/cubestore/cubestore/src/cachestore/cache_rocksstore.rs","lineNumber":1988,"sourceCode":"    }\n\n    async fn cache_keys(&self, _prefix: String) -> Result<Vec<IdRow<CacheItem>>, CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! cache_keys was used.\")\n    }\n\n    async fn cache_incr(&self, _: String) -> Result<IdRow<CacheItem>, CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! cache_incr was used.\")\n    }\n\n    async fn queue_all(&self, _limit: Option<usize>) -> Result<Vec<QueueAllItem>, CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! queue_all was used.\")\n    }\n\n    async fn queue_results_all(\n        &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> {","sourceCodeStart":1970,"sourceCodeEnd":2006,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cubestore/cubestore/src/cachestore/cache_rocksstore.rs#L1970-L2006","documentation":"CubeStore's CacheStore is the store implementation used on worker nodes, which only serve cache/partition data. The queue subsystem (pre-aggregation queue operations) must run on the metastore node, so CacheStore implements queue methods as unconditional panics. Calling queue_results_all on a worker node immediately panics with this message instead of returning a Result.","triggerScenarios":"A node configured as a CubeStore worker (not the metastore leader) receives or executes a call to queue_results_all — e.g. queue inspection/management code or query orchestration that fetches all queue results routed to the wrong node.","commonSituations":"Misconfigured cluster where a worker is mistakenly contacted for queue management (REST/metastore API calls pointed at a worker instead of the metastore node); custom tooling calling queue APIs against worker addresses; single-binary dev setup assumptions broken after splitting into worker/metastore roles.","solutions":["Route queue operations to the metastore node (the node running the RocksDB metastore), not a cache/worker node.","Check your CubeStore topology: only the node launched with metastore/leader responsibilities should serve queue APIs.","If using cube store REST/metastore endpoints, update client config (host/port) to point at the metastore instance.","If running all-in-one locally, ensure the process is started in a mode where queue APIs are backed by the real MetastoreRocksStore, not CacheStore."],"exampleFix":"// before: queue management call sent to worker host\nconst store = cubeStoreClient('worker-host:3030');\nawait store.queueResultsAll();\n// after: point at the metastore host\nconst store = cubeStoreClient('metastore-host:3030');\nawait store.queueResultsAll();","handlingStrategy":"validation","validationCode":"// before calling queue APIs, verify the node is the metastore\nasync fn ensure_metastore(node: &CubeStoreNode) -> Result<(), CubeError> {\n    if node.role() != NodeRole::Metastore {\n        return Err(CubeError::internal(\"queue APIs require the metastore node\"));\n    }\n    Ok(())\n}","typeGuard":"fn is_metastore(node: &CubeStoreNode) -> bool {\n    matches!(node.role(), NodeRole::Metastore)\n}","tryCatchPattern":null,"preventionTips":["Keep separate connection configs for metastore vs worker nodes.","Never send queue API traffic through load balancers that include workers.","Confirm node role in startup logs before enabling queue features.","In dev, run the all-in-one mode so CacheStore is never selected for queue calls."],"tags":["cubestore","rust","topology","panics"],"backgroundTag":"wrong-node-role","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}