{"record":{"id":"1bd218e960359a5b","repo":"cube-js/cube","slug":"cachestore-cannot-be-used-on-the-worker-node-queu-1bd218","errorCode":null,"errorMessage":"CacheStore cannot be used on the worker node! queue_heartbeat_by_id was used.","messagePattern":"CacheStore cannot be used on the worker node! queue_heartbeat_by_id was used\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/cubestore/cubestore/src/cachestore/cache_rocksstore.rs","lineNumber":2039,"sourceCode":"        _prefix: String,\n        _status_filter: Option<QueueItemStatus>,\n        _priority_sort: bool,\n        _with_payload: bool,\n        _caller_process_id: Option<String>,\n    ) -> Result<Vec<QueueListItem>, CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! queue_list was used.\")\n    }\n\n    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,","sourceCodeStart":2021,"sourceCodeEnd":2057,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cubestore/cubestore/src/cachestore/cache_rocksstore.rs#L2021-L2057","documentation":"queue_heartbeat renews a queue item's lease so it isn't considered orphaned; it must run against the metastore's queue state. CacheStore on a worker panics (note the message says queue_heartbeat_by_id, a naming inconsistency in the panic string).","triggerScenarios":"A worker processing loop or client calling queue_heartbeat (QueueKey) against CacheStore — e.g. heartbeat logic misrouted from a build worker to the wrong node.","commonSituations":"Heartbeat timers configured with the address of a cache/worker node; after topology changes the heartbeat target wasn't updated to the metastore; long-running pre-aggregation builds whose keep-alive hits the wrong node, causing spurious orphaning.","solutions":["Point heartbeats at the metastore node that owns the queue item.","Update heartbeat target after any metastore failover/migration.","Ensure worker processes only fetch/process items and never renew leases via a worker store.","If repeated, check that the item still exists — heartbeat calls for cancelled items may indicate stale keys."],"exampleFix":"// before: heartbeat routed to worker store\nheartbeat_target = worker_addr;\n// after\nheartbeat_target = metastore_addr;","handlingStrategy":"validation","validationCode":"if !is_metastore(node) {\n    return Err(CubeError::internal(\"queue_heartbeat requires the metastore node\"));\n}\nnode.queueHeartbeat(key).await?;","typeGuard":"fn is_metastore(node: &CubeStoreNode) -> bool {\n    matches!(node.role(), NodeRole::Metastore)\n}","tryCatchPattern":null,"preventionTips":["Update heartbeat targets after metastore failover.","Only workers' processing logic (backed by metastore connection) should renew leases.","Alert on heartbeat failures — silent misrouting causes spurious orphan-cancellation of running builds."],"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"}