{"record":{"id":"2e30141c3a6807d6","repo":"xai-org/grok-build","slug":"msg","errorCode":null,"errorMessage":"{msg}","messagePattern":"\\{msg\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-grok-pager/src/app/session_startup.rs","lineNumber":1220,"sourceCode":"            } else if let Some(Err(e)) = restore_result {\n                format!(\n                    \"Remote restore failed ({e:#}); continuing with conversation {local_session_id}.\"\n                )\n            } else {\n                format!(\n                    \"Remote restore incomplete; continuing with conversation {local_session_id}.\"\n                )\n            };\n            emit_pre_tui_restore_line(progress_on_stdout, &msg);\n            Ok(ResolvedExisting {\n                id: local_session_id,\n                original_cwd: None,\n                title: None,\n                deferred_local_miss: false,\n                suppress_code_restore: true,\n            })\n        }\n        RemoteRestoreOutcome::Failed(msg) => anyhow::bail!(\"{msg}\"),\n    }\n}\nfn emit_pre_tui_restore_line(on_stdout: bool, line: &str) {\n    use std::io::Write;\n    if on_stdout {\n        println!(\"{line}\");\n        let _ = std::io::stdout().flush();\n    } else {\n        eprintln!(\"{line}\");\n        let _ = std::io::stderr().flush();\n    }\n}\n#[derive(Debug, Clone, PartialEq, Eq)]\npub(crate) enum RemoteRestoreOutcome {\n    Restored { local_session_id: String },\n    RecoveredAfterFailure { local_session_id: String },\n    Failed(String),\n}","sourceCodeStart":1202,"sourceCodeEnd":1238,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-grok-pager/src/app/session_startup.rs#L1202-L1238","documentation":"In the remote restore flow, `RemoteRestoreOutcome::Failed(msg)` carries a failure message produced deeper in the restore pipeline (network, deserialization, or write failure while materializing the remote session). This site re-raises it verbatim via `anyhow::bail!(\"{msg}\")`, so the actual text depends on the underlying restore step that failed.","triggerScenarios":"Calling the resume/startup path where `restore_session_from_remote(...)` (or a sibling step) returns `RemoteRestoreOutcome::Failed(msg)` — e.g. remote fetch error, snapshot parse failure, or failure writing the restored session files locally.","commonSituations":"Network outage or proxy blocking the remote backend during resume; remote snapshot format from an older CLI version; disk/permission errors when writing restored session state into the worktree.","solutions":["Read the propagated `msg` in the error output to identify the underlying failure and fix that directly.","Check connectivity/auth to the remote session backend, then retry the resume.","Upgrade/downgrade the CLI so its snapshot format matches the one stored remotely.","Ensure the target worktree is writable (permissions, disk space) before resuming."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Pre-check connectivity/auth to the remote backend before resuming\nlet healthy = remote_backend_health_check().unwrap_or(false);\nif !healthy { eprintln!(\"Remote backend unreachable; fix network/auth before resume\"); }","typeGuard":null,"tryCatchPattern":"match grok_resume_remote(id) {\n    Err(e) => {\n        eprintln!(\"Remote restore failed: {e}\");\n        // surface the propagated `msg`, fix root cause, then retry once\n        std::thread::sleep(Duration::from_secs(2));\n        grok_resume_remote(id)?;\n    }\n    Ok(v) => Ok(v),\n}","preventionTips":["Ensure network/proxy access to the remote session backend before scripted resumes","Keep CLI versions in sync with the backend snapshot format","Verify the worktree is writable before attempting restore"],"tags":["session-restore","network","propagated-error"],"backgroundTag":"remote-restore-failed","analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}