{"record":{"id":"2d7924009c9fb9ee","repo":"jdx/mise","slug":"target-on-changed-after-it-was-installed-a","errorCode":null,"errorMessage":"{target} on '{}' changed after it was installed; another writer owns that path","messagePattern":"(.+?) on '(.+?)' changed after it was installed; another writer owns that path","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/system/remote.rs","lineNumber":1082,"sourceCode":"    if remote_executable_sha256(session, target)\n        .await?\n        .is_some_and(|installed| installed == expected)\n    {\n        info!(\n            \"mise is already installed at {target} on {}\",\n            session.host.name\n        );\n        return Ok(());\n    }\n    let file = File::open(binary)\n        .wrap_err_with(|| format!(\"failed to open mise binary {}\", binary.display()))?;\n    session\n        .status_with_stdin_async(&[\"sh\", \"-c\", &install_mise_script(target)], file)\n        .await?;\n    // An install path can be writable by more than the SSH account, so confirm\n    // the executable about to run is the one that was just written.\n    match remote_executable_sha256(session, target).await? {\n        Some(installed) if installed != expected => bail!(\n            \"{target} on '{}' changed after it was installed; another writer owns that path\",\n            session.host.name\n        ),\n        Some(_) => {}\n        None => warn!(\n            \"cannot verify the mise installed at {target} on {}; the host returned no SHA-256 digest\",\n            session.host.name\n        ),\n    }\n    info!(\"installed mise to {target} on {}\", session.host.name);\n    Ok(())\n}\n\n/// Writes beside the target and renames, so a replaced executable is never\n/// truncated in place and a busy binary cannot fail with ETXTBSY. The write\n/// goes into a `mktemp -d` directory rather than a named sibling file: that\n/// directory is private to the SSH account, so nobody else can swap the path\n/// out from under `cat` in a shared writable install directory. A directory at","sourceCodeStart":1064,"sourceCodeEnd":1100,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/remote.rs#L1064-L1100","documentation":"After installing the mise binary at a target path on the remote host, mise computes the remote file's SHA-256 and compares it to the expected digest. This error means the executable at `target` on the given host changed between install and verification, indicating another process or account is writing to that install path. mise bails rather than running a binary it did not write.","triggerScenarios":"provision_mise installs mise at `target` via `sh -c install_mise_script(target)`, then remote_executable_sha256 returns a digest that differs from the expected one; raised from the install verification step on the remote host.","commonSituations":"The install path (e.g. /usr/local/bin/mise or a shared ~/.local/bin) is also managed by a package manager, ansible run, or another user's cron; a system-wide mise package auto-replaced the binary; concurrent mise provisioning jobs raced on the same host.","solutions":["Pick a target path writable only by the SSH account (e.g. ~/.local/bin/mise) instead of a shared system path","Stop or reconfigure the other writer (system mise package, config-management tool) on that path","Re-run provisioning when no concurrent installs are running","If the warning variant (no digest returned) appears instead, ensure sha256sum exists on the host"],"exampleFix":"# before: shared path other tools also write\ntarget = \"/usr/local/bin/mise\"\n# after: user-owned path\ntarget = \"~/.local/bin/mise\"","handlingStrategy":"try-catch","validationCode":"# preflight: confirm no other manager owns the target path\ndpkg -S \"$(readlink -f \"$TARGET\")\" 2>/dev/null && echo \"owned by a package; choose another path\"\nstat -c '%U %a' \"$TARGET\" 2>/dev/null","typeGuard":null,"tryCatchPattern":"match provision_mise(&session, staging, &project, false, &mut resolver).await {\n    Ok(target) => target,\n    Err(e) if e.to_string().contains(\"changed after it was installed\") => {\n        warn!(\"shared install path is being written by another process\");\n        // fall back to a user-owned target and retry once\n        provision_mise(&session, staging, &project, true, &mut resolver).await?\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Install mise to a user-owned path (~/.local/bin) on shared hosts","Exclude the mise binary from package managers and config-management tooling","Avoid concurrent provisioning runs against the same host","Ensure sha256sum exists on the host so verification can run"],"tags":["remote","security","checksum","ssh"],"backgroundTag":"checksum-mismatch","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"}