{"record":{"id":"803cbc8828b12e43","repo":"jdx/mise","slug":"remote-host-identity-file-does-not-exist","errorCode":null,"errorMessage":"remote host '{}' identity file does not exist: {}","messagePattern":"remote host '(.+?)' identity file does not exist: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/remote.rs","lineNumber":345,"sourceCode":"        }\n        if archive && !self.source.is_dir() {\n            bail!(\n                \"remote host '{}' source is not a directory: {}\",\n                self.name,\n                self.source.display()\n            );\n        }\n        if archive && !self.copy_links {\n            for link in &self.copy_link {\n                validate_copy_link(&self.source, link).wrap_err_with(|| {\n                    format!(\"remote host '{}' has invalid copy_link\", self.name)\n                })?;\n            }\n        }\n        if let Some(identity) = &self.identity_file\n            && !identity.is_file()\n        {\n            bail!(\n                \"remote host '{}' identity file does not exist: {}\",\n                self.name,\n                identity.display()\n            );\n        }\n        if let Some(binary) = &self.mise_bin\n            && !binary.is_file()\n        {\n            bail!(\n                \"remote host '{}' mise binary does not exist: {}\",\n                self.name,\n                binary.display()\n            );\n        }\n        let provisioning_strategies = [\n            self.mise_bin.is_some(),\n            self.remote_mise.is_some(),\n            self.bootstrap_command.is_some(),","sourceCodeStart":327,"sourceCodeEnd":363,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/remote.rs#L327-L363","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Generate the key if missing: ssh-keygen -t ed25519 -f <path>.","Fix the path (absolute path avoids ~ expansion issues) in the remote host config.","Copy the private key to this machine with correct permissions (chmod 600).","Remove the identity_file key to fall back to ssh-agent/default keys."],"exampleFix":"// before\nidentity_file = \"~/.ssh/old_key_ed25519\"\n// after\nidentity_file = \"/home/user/.ssh/id_ed25519\"","handlingStrategy":"validation","validationCode":"const fs = require('fs');\nfunction assertIdentityFile(host) {\n  if (host.identity_file && !fs.statSync(host.identity_file).isFile()) {\n    throw new Error(`identity file missing: ${host.identity_file}`);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use absolute, fully expanded paths for identity files (avoid ~ in generated config).","Point at the private key, never the .pub file.","Provision keys with a setup script (ssh-keygen + chmod 600) before remote operations.","Prefer ssh-agent and omit identity_file when the key is already loaded."],"tags":["remote","ssh","configuration","file-not-found"],"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"}