{"record":{"id":"8e13380f19675d27","repo":"tinyhumansai/openhuman","slug":"cost-tracker-unavailable-cached-failure-retry-in","errorCode":null,"errorMessage":"cost tracker unavailable (cached failure, retry in {:?}): {err}","messagePattern":"cost tracker unavailable \\(cached failure, retry in (.+?)\\): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/platform/cost/rpc.rs","lineNumber":342,"sourceCode":"    log::warn!(target: \"cost_rpc\", \"[cost_rpc] resolve_tracker.global_miss — falling back to per-call tracker\");\n\n    let workspace = config.workspace_dir.clone();\n    let mut guard = FALLBACK_TRACKER.lock();\n\n    // Reuse the cached tracker only when the workspace path is unchanged.\n    if let Some(state) = guard.as_ref() {\n        if state.workspace == workspace {\n            if let Some(tracker) = &state.tracker {\n                log::debug!(target: \"cost_rpc\", \"[cost_rpc] resolve_tracker.fallback_cached_hit\");\n                return Ok(tracker.clone());\n            }\n            if let Some((when, err)) = &state.last_error {\n                if when.elapsed() < FALLBACK_ERROR_TTL {\n                    log::debug!(\n                        target: \"cost_rpc\",\n                        \"[cost_rpc] resolve_tracker.fallback_cached_error replay — err={err}\"\n                    );\n                    return Err(anyhow!(\n                        \"cost tracker unavailable (cached failure, retry in {:?}): {err}\",\n                        FALLBACK_ERROR_TTL - when.elapsed()\n                    ));\n                }\n            }\n        }\n    }\n\n    match CostTracker::new(config.cost.clone(), &workspace) {\n        Ok(tracker) => {\n            log::debug!(target: \"cost_rpc\", \"[cost_rpc] resolve_tracker.fallback_ready workspace={}\", workspace.display());\n            let arc = Arc::new(tracker);\n            *guard = Some(FallbackState {\n                workspace,\n                tracker: Some(arc.clone()),\n                last_error: None,\n            });\n            Ok(arc)","sourceCodeStart":324,"sourceCodeEnd":360,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/platform/cost/rpc.rs#L324-L360","documentation":"The cost RPC fallback path cannot produce a cost tracker: the global registry lookup missed, and the previously cached attempt to build a per-workspace tracker failed and is still inside its backoff window (the retry interval is interpolated into the message). Rather than hammering a broken init path on every RPC call, the failure is cached for a bounded period; during that window tracker-dependent calls return this error. Common root causes are a corrupt or locked cost database under the workspace or transient filesystem errors at tracker construction.","triggerScenarios":"Thrown at src/openhuman/platform/cost/rpc.rs:342 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wait for the backoff window shown in the message to elapse — the next call retries construction","Check the workspace cost database for corruption or lock contention (another process holding it)","Restart the core to clear the cached-failure state immediately if the underlying cause is fixed"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}