tinyhumansai/openhuman · error

SESSION_EXPIRED

SESSION_EXPIRED

Error message

SESSION_EXPIRED: backend rejected session token on {method} {path} (401 for {url}: {detail}) — sign in again to resume

What it means

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.

Source

Thrown at src/openhuman/integrations/client.rs:446

            "integrations",
            method,
            &[("path", path), ("failure", "transport")],
        );
        anyhow::anyhow!("{} {} failed: {}", method.to_uppercase(), url, chain)
    }

    fn map_sdk_error(error: SdkError, method: &str, path: &str, url: &str) -> anyhow::Error {
        let method_upper = method.to_uppercase();
        match error {
            SdkError::Http(error) => Self::report_transport_error(error, method, path, url),
            SdkError::Status { status, body } => {
                let body_text = match body {
                    serde_json::Value::String(text) => text,
                    value => value.to_string(),
                };
                let detail = extract_error_detail(&body_text, MAX_ERROR_BODY_LEN);
                if status == reqwest::StatusCode::UNAUTHORIZED.as_u16() {
                    return anyhow::anyhow!(handle_session_jwt_unauthorized(
                        &method_upper,
                        path,
                        url,
                        &detail
                    ));
                }
                let status_text = reqwest::StatusCode::from_u16(status)
                    .map(|status| status.to_string())
                    .unwrap_or_else(|_| status.to_string());
                let status_code = status.to_string();
                crate::core::observability::report_error_or_expected(
                    format!("Backend returned {status_text} for {method_upper} {url}: {detail}")
                        .as_str(),
                    "integrations",
                    method,
                    &[
                        ("path", path),
                        ("status", status_code.as_str()),

View on GitHub (pinned to 7491200858)

Solutions

  1. Sign in again to obtain a fresh session token
  2. Verify the clock on the machine is not skewed (expired-looking tokens)
  3. Check the session was not revoked from another device
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/integrations/client.rs:446 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/cb7f7eb068250411. Report an issue: GitHub.