{"record":{"id":"c4056cc6a6f1b312","repo":"cube-js/cube","slug":"cachestore-cannot-be-used-on-the-worker-node-heal","errorCode":null,"errorMessage":"CacheStore cannot be used on the worker node! healthcheck was used.","messagePattern":"CacheStore cannot be used on the worker node! healthcheck was used\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/cubestore/cubestore/src/cachestore/cache_rocksstore.rs","lineNumber":2092,"sourceCode":"\n    async fn compaction(&self) -> Result<(), CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! compaction was used.\")\n    }\n\n    async fn info(&self) -> Result<CachestoreInfo, CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! info was used.\")\n    }\n\n    async fn eviction(&self) -> Result<EvictionResult, CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! eviction was used.\")\n    }\n\n    async fn persist(&self) -> Result<(), CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! persist was used.\")\n    }\n\n    async fn healthcheck(&self) -> Result<(), CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! healthcheck was used.\")\n    }\n\n    async fn rocksdb_properties(&self) -> Result<Vec<RocksPropertyRow>, CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! rocksdb_properties was used.\")\n    }\n\n    async fn wipe(&self) -> Result<(), CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! wipe was used.\")\n    }\n}\n\ncrate::di_service!(ClusterCacheStoreClient, [CacheStore]);\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use crate::cachestore::{CacheEvictionPolicy, EvictionFinishedResult};\n    use crate::config::{init_test_logger, ConfigObjImpl, CubeServices};","sourceCodeStart":2074,"sourceCodeEnd":2110,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cubestore/cubestore/src/cachestore/cache_rocksstore.rs#L2074-L2110","documentation":"CacheStore::healthcheck on worker nodes is an unconditional panic! stub (cache_rocksstore.rs:2092), so even a health probe routed to the worker cache store crashes with this message. It exists purely as a guard: these CacheStore operations must never be called in worker mode.","triggerScenarios":"Calling CacheStore::healthcheck() on a worker-node CacheStore (cache_rocksstore.rs:2092), typically from a health-check loop or load-balancer probe wired to the wrong endpoint.","commonSituations":"Load balancers/health probes targeting worker nodes with a master-only health endpoint; startup code that probes the store before role detection completes.","solutions":["Point health checks at the master node's store/endpoint","Use a worker-appropriate health probe instead of CacheStore::healthcheck","Complete role detection before installing health-check loops"],"exampleFix":"// before\n// probe on all nodes\nstore.healthcheck().await?;\n// after\nif is_master { store.healthcheck().await?; } else { worker_healthcheck().await?; }","handlingStrategy":"fallback","validationCode":"if is_master { store.healthcheck().await?; } else { worker_probe().await?; }","typeGuard":"fn health_probe_available(store: &dyn CacheStore) -> bool { node_role == NodeRole::Master }","tryCatchPattern":"let ok = std::panic::catch_unwind(AssertUnwindSafe(|| store.healthcheck())).map(|r| r.is_ok()).unwrap_or(false);","preventionTips":["Use worker-appropriate health endpoints for workers","Never probe CacheStore::healthcheck on non-master nodes","Configure load balancers with role-specific health paths","Complete role detection before health loops start"],"tags":["cubestore","rust","panic","cache-store","worker-node","healthcheck"],"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"}