{"record":{"id":"41a4746761efaee7","repo":"jdx/mise","slug":"remote-host-source-is-not-a-directory","errorCode":null,"errorMessage":"remote host '{}' source is not a directory: {}","messagePattern":"remote host '(.+?)' source is not a directory: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/remote.rs","lineNumber":329,"sourceCode":"            Some(user) => format!(\"{user}@{}\", self.host),\n            None => self.host.clone(),\n        }\n    }\n\n    fn validate(&self) -> Result<()> {\n        self.validate_with_source(true)\n    }\n\n    fn validate_with_source(&self, archive: bool) -> Result<()> {\n        validate_ssh_atom(\"host\", &self.host)?;\n        if let Some(user) = &self.user {\n            validate_ssh_atom(\"user\", user)?;\n        }\n        if self.port == Some(0) {\n            bail!(\"remote host '{}' port must be greater than zero\", self.name);\n        }\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,","sourceCodeStart":311,"sourceCodeEnd":347,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/remote.rs#L311-L347","documentation":"Thrown by `RemoteHostConfig::validate_with_source` when performing an archive-style remote operation (`archive = true`) and the configured `source` path for a host is not an existing directory on the local filesystem. Archive mode rsyncs a directory tree, so a missing or file-type source is invalid.","triggerScenarios":"Running a remote archive/backup with a host whose `source` points to a file, a non-existent path, or a path that was deleted/moved before the operation; validation is invoked via `validate` or `apply_overrides`.","commonSituations":"Typo in the source directory path; source directory removed by a clean step before the backup; using a single-file path where a directory is required; relative path resolved against an unexpected working directory.","solutions":["Ensure the `source` path exists and is a directory (`mkdir -p <path>` or fix the path)","Verify the path is absolute or relative to the expected working directory","If you meant to sync a single file, use non-archive mode or restructure the source"],"exampleFix":"// before\n[[remote_backup.hosts]]\nname = \"prod\"\nsource = \"/var/log/app.log\"\n// after\n[[remote_backup.hosts]]\nname = \"prod\"\nsource = \"/var/log\"","handlingStrategy":"validation","validationCode":"if !source.is_dir() {\n    panic!(\"remote source must be an existing directory: {}\", source.display());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check `test -d <source>` before running remote archive operations","Use absolute paths for `source` to avoid CWD ambiguity","Ensure cleanup steps don't delete the source directory before the backup runs"],"tags":["remote","rsync","config-validation","filesystem"],"backgroundTag":"path-is-not-a-directory","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"}