jdx/mise · error

remote host ' ' source is not a directory

Error message

remote host '{}' source is not a directory: {}

What it means

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.

Solutions

  1. Correct the `source` path to the directory you intend to sync (use an absolute path).
  2. Create the directory if it should exist: mkdir -p <path>.
  3. Disable archive mode if you actually intended a non-archive sync, or point source at the right file-based flow.
  4. Verify with `ls -la <path>` that it is a directory before running.

Example fix

// before
source = "./dist.tar.gz"
// after
source = "./dist"
Defensive patterns

Strategy: validation

Validate before calling

const fs = require('fs');
function assertSourceDir(host) {
  if (host.archive && !fs.statSync(host.source).isDirectory()) {
    throw new Error(`remote host '${host.name}' source is not a directory: ${host.source}`);
  }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/41a4746761efaee7. Report an issue: GitHub.

Appendix: source

Thrown at src/system/remote.rs:329

            Some(user) => format!("{user}@{}", self.host),
            None => self.host.clone(),
        }
    }

    fn validate(&self) -> Result<()> {
        self.validate_with_source(true)
    }

    fn validate_with_source(&self, archive: bool) -> Result<()> {
        validate_ssh_atom("host", &self.host)?;
        if let Some(user) = &self.user {
            validate_ssh_atom("user", user)?;
        }
        if self.port == Some(0) {
            bail!("remote host '{}' port must be greater than zero", self.name);
        }
        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,

View on GitHub (pinned to 533346cc37)