{"record":{"id":"7bd41f515d74d7fa","repo":"jdx/mise","slug":"could-not-reuse-the-fetched-setup-preview","errorCode":null,"errorMessage":"could not reuse the fetched setup preview","messagePattern":"could not reuse the fetched setup preview","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/sync/onboard.rs","lineNumber":363,"sourceCode":"}\n\n/// Reuse the fully fetched preview after consent, without touching local HEAD\n/// or importing preview decisions. The following normal remote fetch still\n/// discovers newer commits and recomputes against current local state.\nfn seed_confirmed_fetch(store: &Store, preview: &Store) -> Result<()> {\n    let _sync = run::lock(store)?;\n    let source = preview\n        .repo()\n        .ok_or_else(|| eyre::eyre!(\"preview requires git\"))?;\n    let destination = store\n        .repo()\n        .ok_or_else(|| eyre::eyre!(\"setup requires git\"))?;\n    let url = url::Url::from_file_path(source.dir())\n        .map_err(|_| eyre::eyre!(\"cannot address the preview repository\"))?;\n    let refspec = format!(\"+{UPSTREAM_REF}:{UPSTREAM_REF}\");\n    let copied = destination.network([\"fetch\", \"--no-tags\", \"--\", url.as_str(), &refspec])?;\n    if !copied.status.success() {\n        bail!(\"could not reuse the fetched setup preview\");\n    }\n    Ok(())\n}\n\n/// Whether this host reaches the repository on its own: with the\n/// session's GitHub relay (its `url.<relay>.insteadOf` rewrites travel as\n/// `GIT_CONFIG_KEY_n`/`GIT_CONFIG_VALUE_n`) taken out of the environment.\n/// Without a relay, whatever works now keeps working.\nasync fn durable_access(url: &str, branch: &str) -> bool {\n    if std::env::var_os(\"MISE_GITHUB_RELAY_SOCKET\").is_none() {\n        return true;\n    }\n    let Some(git) = crate::file::which_spawnable(\"git\") else {\n        return true;\n    };\n    if super::network::validate_url(url).is_err() {\n        return false;\n    }","sourceCodeStart":345,"sourceCodeEnd":381,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/history/sync/onboard.rs#L345-L381","documentation":"Fallback failure in seed_confirmed_fetch: after user consent, mise tried to reuse the already-fetched preview store's git objects to seed the real store (avoiding a re-download) and this reuse failed (e.g. missing repo, fetch-from-local-URL error). The message signals the optimization failed and the caller should fall back to a normal fetch.","triggerScenarios":"Thrown at src/system/history/sync/onboard.rs:363 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the operation so the normal remote fetch path runs instead of the seeding shortcut","Check that the preview store's git directory still exists and is readable","If it recurs, investigate git object transfer between the two store repos"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}