jdx/mise · error

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

Error message

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

What it means

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.

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 afd2eddd3a)

Solutions

  1. Ensure the `source` path exists and is a directory (`mkdir -p <path>` or fix the path)
  2. Verify the path is absolute or relative to the expected working directory
  3. If you meant to sync a single file, use non-archive mode or restructure the source

Example fix

// before
[[remote_backup.hosts]]
name = "prod"
source = "/var/log/app.log"
// after
[[remote_backup.hosts]]
name = "prod"
source = "/var/log"
Defensive patterns

Strategy: validation

Validate before calling

if !source.is_dir() {
    panic!("remote source must be an existing directory: {}", source.display());
}

Prevention

When it happens

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

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

Related errors


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