jdx/mise · error

remote host '{}' identity file does not exist: {}

Error message

remote host '{}' identity file does not exist: {}

What it means

Thrown by `RemoteHostConfig::validate_with_source` when a remote host entry specifies an `identity_file` for SSH that does not exist as a file on the local machine. mise checks this eagerly so the SSH/rsync invocation does not fail later with a cryptic permission or identity error.

Source

Thrown at src/system/remote.rs:345

        }
        if archive && !self.source.is_dir() {
            bail!(
                "remote host '{}' source is not a directory: {}",
                self.name,
                self.source.display()
            );
        }
        if archive && !self.copy_links {
            for link in &self.copy_link {
                validate_copy_link(&self.source, link).wrap_err_with(|| {
                    format!("remote host '{}' has invalid copy_link", self.name)
                })?;
            }
        }
        if let Some(identity) = &self.identity_file
            && !identity.is_file()
        {
            bail!(
                "remote host '{}' identity file does not exist: {}",
                self.name,
                identity.display()
            );
        }
        if let Some(binary) = &self.mise_bin
            && !binary.is_file()
        {
            bail!(
                "remote host '{}' mise binary does not exist: {}",
                self.name,
                binary.display()
            );
        }
        let provisioning_strategies = [
            self.mise_bin.is_some(),
            self.remote_mise.is_some(),
            self.bootstrap_command.is_some(),

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Fix the `identity_file` path to point at an existing private key file
  2. Remove the `identity_file` setting and rely on ssh-agent/default keys
  3. Generate or restore the missing key at the configured path

Example fix

// before
identity_file = "~/.ssh/id_rsa_old"
// after
identity_file = "~/.ssh/id_ed25519"
Defensive patterns

Strategy: validation

Validate before calling

let identity = shellexpand::tilde(&identity_file);
if !Path::new(identity.as_ref()).is_file() {
    panic!("identity file missing: {}", identity);
}

Prevention

When it happens

Trigger: Setting `identity_file` in a remote host config to a path that is missing, deleted, mis-typed, or points to a directory; triggered by `validate` or `apply_overrides` before any connection is attempted.

Common situations: Key regenerated or rotated and old path removed; wrong user home in the path; config copied from another machine with different key layout; ssh-agent holds the key but a stale identity_file is still configured.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/803cbc8828b12e43. Report an issue: GitHub.