jdx/mise · error

remote host ' ' identity file does not exist

Error message

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

What it means

A configured SSH identity file for the remote host must exist on the local machine; validate_with_source stats the path and bails when identity_file is set but not an existing regular file. This fails fast before attempting any SSH connection.

Solutions

  1. Generate the key if missing: ssh-keygen -t ed25519 -f <path>.
  2. Fix the path (absolute path avoids ~ expansion issues) in the remote host config.
  3. Copy the private key to this machine with correct permissions (chmod 600).
  4. Remove the identity_file key to fall back to ssh-agent/default keys.

Example fix

// before
identity_file = "~/.ssh/old_key_ed25519"
// after
identity_file = "/home/user/.ssh/id_ed25519"
Defensive patterns

Strategy: validation

Validate before calling

const fs = require('fs');
function assertIdentityFile(host) {
  if (host.identity_file && !fs.statSync(host.identity_file).isFile()) {
    throw new Error(`identity file missing: ${host.identity_file}`);
  }
}

Prevention

When it happens

Trigger: A remote host entry sets `identity_file = "..."` and the path is missing or is a directory; validate() or apply_overrides() run the check and bail.

Common situations: Key generated on another machine and never copied; path typo or `~` not expanded as expected; key file deleted by cleanup tooling; pointing at a .pub public key that was rotated out; copying config between machines with different HOME.

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@533346cc37 (2026-09-17). Data as JSON: /api/errors/803cbc8828b12e43. Report an issue: GitHub.

Appendix: 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 533346cc37)