{"record":{"id":"1db63d9124390d45","repo":"jdx/mise","slug":"msg-1db63d","errorCode":null,"errorMessage":"{msg}","messagePattern":"\\{msg\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/self_update.rs","lineNumber":467,"sourceCode":"        let msg = formatdoc! {r#\"\n            TEMP is too long to replace mise.exe safely ({len} UTF-16 code units)\n\n              TEMP = {tmp}\n\n            Updating moves the running mise.exe aside and then launches a helper from TEMP to\n            put the new one in place. That helper's path would be {helper} UTF-16 code units,\n            and Windows cannot launch an executable whose path reaches {max}. The move happens\n            first, so going ahead would leave no mise installed at all.\n\n            Point TEMP and TMP at a shorter directory and run mise self-update again:\n\n              $env:TEMP = 'C:\\Temp'; $env:TMP = 'C:\\Temp'\"#,\n            len = tmp.as_os_str().encode_wide().count(),\n            tmp = tmp.display(),\n            helper = helper_path_len(&tmp, stem.as_deref()),\n            max = MAX_PATH,\n        };\n        bail!(\"{msg}\");\n    }\n\n    fn do_update(&self) -> Result<VersionStatus> {\n        // Use block_in_place to allow self_update's blocking HTTP calls\n        // to work within mise's async runtime\n        tokio::task::block_in_place(|| self.do_update_blocking())\n    }\n\n    fn do_update_blocking(&self) -> Result<VersionStatus> {\n        let settings = Settings::try_get();\n        let source = settings\n            .as_ref()\n            .map(|settings| SelfUpdateSource::from_settings(settings))\n            .unwrap_or_default();\n        source.validate()?;\n        let (repo_owner, repo_name) = source.repository_parts()?;\n        let mut update = Update::configure();\n        update.reqwest_client(Self::http_client()?);","sourceCodeStart":449,"sourceCodeEnd":485,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/self_update.rs#L449-L485","documentation":"On Windows, `ensure_temp_dir_can_replace_binary` validates that the TEMP directory path is short enough that the update's rename/replace operations will not exceed the Windows MAX_PATH limit, computing the longest expected helper path. If the projected path length exceeds MAX_PATH, the update aborts with a detailed message showing the TEMP path, its length, the computed helper path length, and the maximum.","triggerScenarios":"Running `mise self-update` on Windows where the TEMP (or TMP) environment variable points to a deeply nested directory such that temp-path + helper-file name exceeds MAX_PATH (260 chars). Common with deep user profiles or relocated TEMP dirs.","commonSituations":"Corporate machines with roaming profiles under very long user directory names; users who set TEMP to a long custom path; CI runners with long workspace paths.","solutions":["Set TEMP/TMP to a short directory: in PowerShell `$env:TEMP='C:\\Temp'; $env:TMP='C:\\Temp'` before running `mise self-update`","Permanently shorten the TEMP location via System Properties > Environment Variables","Enable Windows long-path support (LongPathsEnabled registry key) — helps some cases but the check still enforces its own limit","Move the user profile or mise install to a shallower path"],"exampleFix":"// before (PowerShell)\n$env:TEMP = 'C:\\Users\\averyveryverylongprofilename\\AppData\\Local\\Temp'; mise self-update  # bail\n// after\n$env:TEMP = 'C:\\Temp'; $env:TMP = 'C:\\Temp'\nmise self-update","handlingStrategy":"validation","validationCode":"$tmp = $env:TEMP\n$len = ($tmp + '\\' + 'mise-self-update-helper' + '.exe').Length\nif ($len -ge 260) { Write-Error \"TEMP path too long for self-update ($len >= 260); set TEMP to a short dir like C:\\Temp\" }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep TEMP/TMP pointed at a short path (C:\\Temp) on machines doing self-updates","Avoid extremely long Windows usernames/profiles for build accounts","Check path lengths before automating self-update on Windows"],"tags":["windows","self-update","path-length"],"backgroundTag":"path-too-long","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"}