{"record":{"id":"34954842c2da981b","repo":"jdx/mise","slug":"runtime-symlink-repair-s-failed","errorCode":null,"errorMessage":"{} runtime symlink repair(s) failed:\n{}","messagePattern":"(.+?) runtime symlink repair\\(s\\) failed:\n(.+?)","errorType":"exception","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/runtime_symlinks.rs","lineNumber":53,"sourceCode":"                backend.ba().short,\n                installs_dir.display()\n            )\n        })\n    })\n}\n\nfn run_all_rebuilds<T>(\n    rebuilds: impl IntoIterator<Item = T>,\n    mut rebuild: impl FnMut(T) -> Result<()>,\n) -> Result<()> {\n    let errors = rebuilds\n        .into_iter()\n        .filter_map(|item| rebuild(item).err())\n        .collect_vec();\n    if errors.is_empty() {\n        return Ok(());\n    }\n    Err(eyre::eyre!(\n        \"{} runtime symlink repair(s) failed:\\n{}\",\n        errors.len(),\n        errors.iter().map(|err| format!(\"{err:#}\")).join(\"\\n\")\n    ))\n}\n\npub(crate) async fn migrate_real_dirs(config: &Config) -> Result<()> {\n    for backend in backend::list() {\n        for installs_dir in install_dirs_for(&backend) {\n            migrate_real_dirs_in_dir(config, &backend, &installs_dir)?;\n        }\n    }\n    Ok(())\n}\n\n/// All install directories to consider for a backend: the backend's primary\n/// installs_path plus any shared/system dirs that contain the tool. Per-dir\n/// rebuilds are no-ops when desired state already matches actual state, so","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/runtime_symlinks.rs#L35-L71","documentation":"Aggregated error from run_all_rebuilds in src/runtime_symlinks.rs. After attempting to repair runtime tool symlinks for every item, any per-item rebuild() failures are collected and combined into one error listing the count and each failure's full chain (`{err:#}` includes causes). The individual failures are surfaced here, not at their original throw site.","triggerScenarios":"Calling rebuild_for_backends (or tests like run_all_rebuilds_attempts_every_item) when one or more rebuild(item) calls return Err — e.g. symlink target install directories missing, permissions problems, or another process holding the path.","commonSituations":"Activation/shim resolution after a partial install was deleted, tool installs removed manually from ~/.local/share/mise while config still references them, or filesystem permission issues in the installs directory.","solutions":["Read the per-item failures in the message body to identify which symlink repairs failed, then fix the root cause of each (usually reinstalling the missing tool version).","Run `mise install` to restore missing tool installs referenced by the config.","Remove stale symlinks/installs directories and let mise rebuild them.","Check filesystem permissions on the mise installs/data directory."],"exampleFix":"// before: ignoring individual rebuild results\nrebuild(item)?;\n// after: surface which item failed\nrebuild(item).map_err(|e| eyre!(\"rebuilding symlinks for {item}: {e:#}\"))?;","handlingStrategy":"try-catch","validationCode":"// check installs referenced by the toolset exist before repairing symlinks\nfor v in ts.resolved_versions() {\n    let p = installs_dir.join(v.to_string());\n    if !p.exists() { eprintln!(\"missing install: {}\", p.display()); }\n}","typeGuard":null,"tryCatchPattern":"match run_all_rebuilds() {\n    Err(e) => {\n        eprintln!(\"runtime symlink repair failed:\\n{e:#}\");\n        // rerun `mise install` to restore missing targets\n    }\n    Ok(()) => {}\n}","preventionTips":["Don't manually delete tool installs; use `mise uninstall`.","Run `mise install` after editing tool versions in config files.","Keep the mise data directory on a filesystem with consistent permissions."],"tags":["symlink","repair","aggregated-error","runtime"],"backgroundTag":"file-not-found","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"}