{"record":{"id":"fddbe3f82770732a","repo":"screenpipe/screenpipe","slug":"status","errorCode":null,"errorMessage":"status: {}","messagePattern":"status: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/screenpipe-engine/src/archive.rs","lineNumber":516,"sourceCode":"                    guard.bytes_written,\n                    output_dir.display()\n                );\n            }\n        }\n    })\n}\n\n/// Download every archived blob and write it to `output_dir`.\nasync fn run_download(\n    manager: &SyncManager,\n    output_dir: &std::path::Path,\n    progress: &Arc<RwLock<DownloadProgress>>,\n) -> anyhow::Result<()> {\n    // Determine the time span of archived data.\n    let status = manager\n        .get_status()\n        .await\n        .map_err(|e| anyhow::anyhow!(\"status: {}\", e))?;\n\n    {\n        let mut g = progress.write().await;\n        g.total_blobs = status.stats.total_blobs as u64;\n    }\n\n    let start = match status.stats.oldest_data.as_deref().and_then(parse_ts) {\n        Some(t) => t,\n        None => {\n            info!(\"archive-download: no archived data found\");\n            return Ok(());\n        }\n    };\n    // Pad the end so the newest instant is included.\n    let end = status\n        .stats\n        .newest_data\n        .as_deref()","sourceCodeStart":498,"sourceCodeEnd":534,"githubUrl":"https://github.com/screenpipe/screenpipe/blob/4ebf712990fee17eeaf904dacf749b6e96ac9bf3/crates/screenpipe-engine/src/archive.rs#L498-L534","documentation":"Wraps a failure of manager.get_status() at the start of run_download. get_status queries the remote archive service for blob counts/stats needed to initialize DownloadProgress.total_blobs; any network, auth, or serialization failure is re-wrapped as 'status: {}'.","triggerScenarios":"spawn_download_task -> run_download calls manager.get_status().await before paging through blobs; the request fails (network error, 401/403 from an invalid token, unexpected server response).","commonSituations":"Offline or flaky network during an archive export; expired archive token causing server rejection; archive backend returning an unexpected payload the client can't parse.","solutions":["Check network connectivity and retry the download","Refresh the archive token — a 401/403 wrapped inside this error means re-authentication is needed","Inspect the root cause for HTTP status or decode errors to target the fix","Retry later if the archive service is temporarily unavailable"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// pre-flight connectivity/token check\nlet reachable = tokio::net::TcpStream::connect((\"archive-host\", 443)).await.is_ok();\nif !reachable { anyhow::bail!(\"archive service unreachable\"); }","typeGuard":null,"tryCatchPattern":"let status = loop {\n    match manager.get_status().await {\n        Ok(s) => break s,\n        Err(e) if attempts < 3 && is_transient(&e) => { attempts += 1; backoff().await; }\n        Err(e) => return Err(anyhow::anyhow!(\"status: {e:#}\")),\n    }\n};","preventionTips":["Retry transient network errors with exponential backoff","Refresh the token when the cause is 401/403","Surface download failure state to the user instead of failing silently","Health-check the archive endpoint before starting long exports"],"tags":["network","sync","download"],"backgroundTag":"archive-status-request-failed","analyzedSha":"4ebf712990fee17eeaf904dacf749b6e96ac9bf3","analyzedAt":"2026-09-01T23:33:43.065Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}