{"record":{"id":"cb7f7eb068250411","repo":"tinyhumansai/openhuman","slug":"session-expired","errorCode":"SESSION_EXPIRED","errorMessage":"SESSION_EXPIRED: backend rejected session token on {method} {path} (401 for {url}: {detail}) — sign in again to resume","messagePattern":"SESSION_EXPIRED: backend rejected session token on (.+?) (.+?) \\(401 for (.+?): (.+?)\\) — sign in again to resume","errorType":"http","errorClass":null,"httpStatus":401,"severity":"error","filePath":"src/openhuman/integrations/client.rs","lineNumber":446,"sourceCode":"            \"integrations\",\n            method,\n            &[(\"path\", path), (\"failure\", \"transport\")],\n        );\n        anyhow::anyhow!(\"{} {} failed: {}\", method.to_uppercase(), url, chain)\n    }\n\n    fn map_sdk_error(error: SdkError, method: &str, path: &str, url: &str) -> anyhow::Error {\n        let method_upper = method.to_uppercase();\n        match error {\n            SdkError::Http(error) => Self::report_transport_error(error, method, path, url),\n            SdkError::Status { status, body } => {\n                let body_text = match body {\n                    serde_json::Value::String(text) => text,\n                    value => value.to_string(),\n                };\n                let detail = extract_error_detail(&body_text, MAX_ERROR_BODY_LEN);\n                if status == reqwest::StatusCode::UNAUTHORIZED.as_u16() {\n                    return anyhow::anyhow!(handle_session_jwt_unauthorized(\n                        &method_upper,\n                        path,\n                        url,\n                        &detail\n                    ));\n                }\n                let status_text = reqwest::StatusCode::from_u16(status)\n                    .map(|status| status.to_string())\n                    .unwrap_or_else(|_| status.to_string());\n                let status_code = status.to_string();\n                crate::core::observability::report_error_or_expected(\n                    format!(\"Backend returned {status_text} for {method_upper} {url}: {detail}\")\n                        .as_str(),\n                    \"integrations\",\n                    method,\n                    &[\n                        (\"path\", path),\n                        (\"status\", status_code.as_str()),","sourceCodeStart":428,"sourceCodeEnd":464,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/integrations/client.rs#L428-L464","documentation":"map_sdk_error's 401 arm: the backend rejected the stored session token for the request. The SESSION_EXPIRED prefix is the classifier signal that downstream code uses to publish session-expiry and force re-auth rather than treating it as a generic failure.","triggerScenarios":"Thrown at src/openhuman/integrations/client.rs:446 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Sign in again to obtain a fresh session token","Verify the clock on the machine is not skewed (expired-looking tokens)","Check the session was not revoked from another device"],"exampleFix":null,"handlingStrategy":"validation","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-14T00:17:10.932Z"}