{"record":{"id":"4e7bd6d5ad3f9c29","repo":"jdx/mise","slug":"installation-failed-previous-lockfiles-were-preserved","errorCode":null,"errorMessage":"installation failed; previous lockfiles were preserved","messagePattern":"installation failed; previous lockfiles were preserved","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lockfile/generate.rs","lineNumber":127,"sourceCode":"                    .collect::<Vec<_>>()\n                    .join(\"\\n\"),\n            );\n            record_install_failure();\n        }\n        errors\n    }\n}\n\npub(crate) fn record_install_failure() {\n    INSTALL_FAILED.store(true, Ordering::Relaxed);\n}\n\npub(crate) fn ensure_install_succeeded() -> Result<()> {\n    if INSTALL_FAILED.load(Ordering::Relaxed) {\n        if let Some(detail) = INSTALL_FAILURE_DETAIL.lock().unwrap().as_ref() {\n            bail!(\"{detail}\\nprevious lockfiles were preserved\");\n        }\n        bail!(\"installation failed; previous lockfiles were preserved\");\n    }\n    Ok(())\n}\n\npub(crate) fn has_previous_file(config: &Config, path: &Path) -> bool {\n    path.exists()\n        || monorepo_lockfile_migration_paths(config)\n            .iter()\n            .any(|(source, target)| target == path && source.exists())\n}\n\npub(crate) fn read_previous(config: &Config, path: &Path, upgrade: bool) -> Result<Lockfile> {\n    let mut previous = Lockfile::read(path)?;\n    let mut exists = path.exists();\n    for (source, target) in monorepo_lockfile_migration_paths(config) {\n        if target != path || !source.exists() {\n            continue;\n        }","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/lockfile/generate.rs#L109-L145","documentation":"The no-detail variant of ensure_install_succeeded: mise knows the install failed (INSTALL_FAILED flag set) but no detailed error text was captured, so it reports the generic message that installation failed and the previous lockfiles were preserved. Existing lockfiles were deliberately not overwritten, so your pinned state is safe.","triggerScenarios":"Tool installation fails during lockfile generation without a recorded failure detail (e.g. an early abort path that sets the flag but not INSTALL_FAILURE_DETAIL); rerunning after a failed generate when the failure cause was cleared.","commonSituations":"Aborted installs (Ctrl-C mid-install during `mise lock`); backend failures on code paths that do not attach detail; CI runs where the install step died unexpectedly.","solutions":["Rerun `mise lock`/`mise install` with MISE_DEBUG=1 to capture the underlying failure cause.","Verify network access and the tool backend (registry reachable, token valid).","Since lockfiles are preserved, retry freely; remove or change the failing tool request if it consistently fails."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if ! mise lock; then MISE_DEBUG=1 mise lock; fi  # retry with debug to surface the hidden cause","preventionTips":["Run with MISE_DEBUG=1 when installs fail so details are captured.","Avoid interrupting (Ctrl-C) `mise lock` mid-install; rerun to completion.","Keep tool backends and tokens healthy before long CI install steps."],"tags":["lockfile","install-failure","preserved-state"],"backgroundTag":"install-failed","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}