jdx/mise · error

remote mise environment cannot contain a comma: {env}

Error message

remote mise environment cannot contain a comma: {env}

What it means

Thrown by `RemoteHostConfig::validate_with_source` when an entry in `mise_env` contains a comma. Remote mise environment variables are passed as a comma-joined list to the remote host, so a comma inside a value would corrupt the serialization and is rejected.

Source

Thrown at src/system/remote.rs:394

                bail!(
                    "remote host '{}' cannot combine install_mise with remote_mise or bootstrap_command, which already provide mise on the host",
                    self.name
                );
            }
            validate_install_mise_path(install_mise).wrap_err_with(|| {
                format!("remote host '{}' has an invalid install_mise", self.name)
            })?;
        }
        for option in &self.ssh_options {
            validate_value("SSH option", option)?;
        }
        for exclude in &self.exclude {
            validate_value("archive exclude", exclude)?;
        }
        for env in &self.mise_env {
            validate_value("mise environment", env)?;
            if env.contains(',') {
                bail!("remote mise environment cannot contain a comma: {env}");
            }
        }
        if let Some(remote_mise) = &self.remote_mise {
            validate_remote_executable(remote_mise)?;
        }
        if self
            .bootstrap_command
            .as_ref()
            .is_some_and(|command| command.contains('\0'))
        {
            bail!("remote host '{}' bootstrap command contains NUL", self.name);
        }
        Ok(())
    }
}

pub(crate) async fn run(
    host: &RemoteHost,

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Remove the comma or split the value into multiple mise_env entries
  2. Encode the value differently (e.g. use a different separator the remote tool accepts)
  3. If a comma-separated list is unavoidable, pass it via a config file or remote env mechanism instead of mise_env

Example fix

// before
mise_env = ["RUSTFLAGS=-C target-cpu=native,lto"]
// after
mise_env = ["RUSTFLAGS=-C target-cpu=native"]
Defensive patterns

Strategy: validation

Validate before calling

for env in &host.mise_env {
    if env.contains(',') {
        panic!("mise_env entry contains comma: {}", env);
    }
}

Prevention

When it happens

Trigger: Setting `mise_env = ["FOO=a,b"]` (or any value containing ',') on a remote host entry and running a remote operation that triggers `validate`/`apply_overrides`.

Common situations: Passing comma-separated lists (e.g. `RUSTFLAGS="-C target-cpu=native,lto"`) through mise_env; unquoted values with commas copied from shell exports.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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