{"record":{"id":"f319ab85b90e13f4","repo":"cube-js/cube","slug":"cachestore-cannot-be-used-on-the-worker-node-queu-f319ab","errorCode":null,"errorMessage":"CacheStore cannot be used on the worker node! queue_retrieve_by_path was used.","messagePattern":"CacheStore cannot be used on the worker node! queue_retrieve_by_path was used\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/cubestore/cubestore/src/cachestore/cache_rocksstore.rs","lineNumber":2048,"sourceCode":"    async fn queue_get(&self, _key: QueueKey) -> Result<Option<QueueGetResponse>, CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! queue_get was used.\")\n    }\n\n    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,","sourceCodeStart":2030,"sourceCodeEnd":2066,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cubestore/cubestore/src/cachestore/cache_rocksstore.rs#L2030-L2066","documentation":"CubeStore's CacheStore (the cache-only RocksDB store used on worker nodes) deliberately panics when any queue-related method is invoked. Queue operations (orchestration queue retrieve/ack/result) are only supported on the full cache store used by the master node; calling them on a worker node indicates a routing/deployment bug where queue work was sent to a node that cannot process it. The panic aborts the calling task with this message.","triggerScenarios":"Calling the CacheStore trait's queue_retrieve_by_path method on a CubeStore worker node instance, where the method is implemented as an unconditional panic! stub (cache_rocksstore.rs:2048).","commonSituations":"Running CubeStore in worker mode but having the queue/processing logic (e.g. query orchestrator queue retrieval) target the local store instead of the master node; misconfigured cluster topology where a worker was promoted or addressed as master.","solutions":["Verify the queue consumer is connected to the master CubeStore node, not a worker node","Check CubeStore startup flags/cluster config so worker nodes never execute queue retrieval; route queue ops via the master","If this panic is hit in tests, construct the store with the full (non-worker) CacheStore implementation instead of the cache-only one"],"exampleFix":"// before: worker node executing queue retrieval locally\nlet resp = cache_store.queue_retrieve_by_path(path, 1, caller_id).await?;\n// after: route queue retrieval to the master node / use the master-backed store\nlet resp = master_cache_store_client.queue_retrieve_by_path(path, 1, caller_id).await?;","handlingStrategy":"validation","validationCode":"if node_role != NodeRole::Master { return Err(CubeError::internal(\"queue ops require master node\")); }\n// only then: store.queue_retrieve_by_path(path, 1, caller_id).await?","typeGuard":"fn is_master_store(store: &dyn CacheStore) -> bool { !std::any::TypeId::of::<CacheRocksStore>().eq(&store.as_any().type_id()) || node_role == NodeRole::Master }","tryCatchPattern":"// panics, not Result errors: guard before calling; optionally catch_unwind\nlet resp = std::panic::catch_unwind(AssertUnwindSafe(|| master_client.queue_retrieve_by_path(...))).map_err(|_| CubeError::internal(\"queue_retrieve_by_path called on worker node\"))?;","preventionTips":["Run queue consumers only on the master CubeStore node","Assert node role at startup before initializing queue loops","Route all queue ops through a remote client to the master","Tag worker deployments so orchestrators cannot schedule queue work on them"],"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"}