{"record":{"id":"3fcf11fb7a8086fa","repo":"cube-js/cube","slug":"cachestore-cannot-be-used-on-the-worker-node-queu","errorCode":null,"errorMessage":"CacheStore cannot be used on the worker node! queue_all was used.","messagePattern":"CacheStore cannot be used on the worker node! queue_all was used\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/cubestore/cubestore/src/cachestore/cache_rocksstore.rs","lineNumber":1981,"sourceCode":"\n    async fn cache_delete(&self, _key: String) -> Result<(), CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! cache_delete was used.\")\n    }\n\n    async fn cache_get(&self, _key: String) -> Result<Option<IdRow<CacheItem>>, CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! cache_get was used.\")\n    }\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(","sourceCodeStart":1963,"sourceCodeEnd":1999,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cubestore/cubestore/src/cachestore/cache_rocksstore.rs#L1963-L1999","documentation":"ClusterCacheStoreClient (worker-node CacheStore) panics on queue_all; scanning the ingestion/query queue is master-only because the queue lives in the master's metastore-backed cache. The worker implementation intentionally unimplemented to catch misrouted queue operations.","triggerScenarios":"Calling queue_all(limit) on a worker node's ClusterCacheStoreClient — e.g. queue-drain or job-fetch logic running on a worker instead of the master.","commonSituations":"Background worker loops instantiated on worker nodes that incorrectly use the local CacheStore for queue fetching; scheduler misconfiguration.","solutions":["Fetch queue items via the master node or the cluster queue client (the intended path for workers).","Ensure worker nodes receive work through the cluster protocol rather than calling CacheStore::queue_all directly.","Audit startup code so the correct CacheStore/queue implementation is injected per node role."],"exampleFix":"// before\nlet items = worker_cache_store.queue_all(limit).await?; // panics on worker\n// after\nlet items = cluster.queue_client().queue_all(limit).await?; // cluster path","handlingStrategy":"validation","validationCode":"if node_role() == Role::Worker {\n    return Err(CubeError::internal(\"queue_all is master-only; use the cluster queue client\"));\n}\nlet items = cache_store.queue_all(limit).await?;","typeGuard":"fn is_master_cache(store: &dyn CacheStore) -> bool {\n    std::any::Any::type_id(store) != std::any::TypeId::of::<ClusterCacheStoreClient>()\n}","tryCatchPattern":"if is_worker_cache_stub(cache_store) {\n    return Err(CubeError::internal(\"fetch queue items via the cluster queue client\"));\n}\nlet items = cache_store.queue_all(limit).await?;","preventionTips":["Workers should receive queue work via the cluster protocol, not CacheStore::queue_all","Inject the queue client appropriate to the node role at startup","Audit background loops for direct CacheStore queue calls","Keep queue-drain logic on the master or use the distributed path"],"tags":["rust","cubestore","cluster","queue","worker-node"],"backgroundTag":"cache-store-worker-node-unsupported","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}