{"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/533346cc374382b41ec5ff70536252b2e96e725c/src/system/remote.rs#L311-L347","documentation":"When a remote sync is configured as an archive (rsync-style archive of a directory tree), the configured `source` path must be a local directory; validate_with_source checks this on the filesystem and bails if it isn't a directory.","triggerScenarios":"archive mode is enabled for a remote host and the `source` field points to a path that does not exist or is a regular file/symlink target rather than a directory; validate() or apply_overrides() stat the path and bail.","commonSituations":"Typo in the source directory path; pointing at a tarball/file instead of a directory; the directory was deleted or renamed after config was written; relative path resolved from a different working directory.","solutions":["Correct the `source` path to the directory you intend to sync (use an absolute path).","Create the directory if it should exist: mkdir -p <path>.","Disable archive mode if you actually intended a non-archive sync, or point source at the right file-based flow.","Verify with `ls -la <path>` that it is a directory before running."],"exampleFix":"// before\nsource = \"./dist.tar.gz\"\n// after\nsource = \"./dist\"","handlingStrategy":"validation","validationCode":"const fs = require('fs');\nfunction assertSourceDir(host) {\n  if (host.archive && !fs.statSync(host.source).isDirectory()) {\n    throw new Error(`remote host '${host.name}' source is not a directory: ${host.source}`);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use absolute paths for source directories in remote host config.","Check `test -d <path>` in CI before deploying remote sync configs.","Don't point archive source at files/tarballs; archive mode expects a directory tree."],"tags":["remote","rsync","configuration","filesystem"],"backgroundTag":"path-is-not-a-directory","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"}