jdx/mise · error

remote host '{}' bootstrap command contains NUL

Error message

remote host '{}' bootstrap command contains NUL

What it means

bootstrap_command is executed verbatim on the remote host via sh -lc, and a C string / argv element cannot contain the NUL byte. validate() therefore rejects the host up front when the configured command contains '\0', instead of letting the SSH exec fail with an opaque error later. In practice the NUL almost always arrives via a TOML \u0000 escape or programmatic construction of the override.

Source

Thrown at src/system/remote.rs:290

                "remote host '{}' must set at most one of mise_bin, remote_mise, or bootstrap_command",
                self.name
            );
        }
        for option in &self.ssh_options {
            validate_value("SSH option", option)?;
        }
        for exclude in &self.exclude {
            validate_value("archive exclude", exclude)?;
        }
        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 async fn run(
    host: &RemoteHost,
    options: &RemoteRunOptions,
    artifacts: &mut RemoteArtifactResolver,
) -> Result<()> {
    let ssh = crate::file::which("ssh").ok_or_else(|| eyre!("required command 'ssh' not found"))?;
    let tar = crate::file::which("tar").ok_or_else(|| eyre!("required command 'tar' not found"))?;
    let control_directory = if cfg!(unix) {
        Some(tempfile::tempdir()?)
    } else {
        None
    };
    let session = SshSession {

View on GitHub (pinned to 9dcfcaa0dc)

Solutions

  1. Retype the bootstrap_command as a plain single-line string with no escape sequences
  2. Grep the config for NUL escapes: search mise.toml for the literal text \u0000 and remove it
  3. If the command is generated programmatically, strip NUL bytes before writing it into the config or passing the flag

Example fix

# before (mise.toml)
bootstrap_command = "printf 'hi\u0000' && curl https://mise.run | sh"

# after
bootstrap_command = "curl https://mise.run | sh"
Defensive patterns

Strategy: validation

Validate before calling

# reject NUL escapes before running
grep -n '\\u0000' mise.toml && echo 'bootstrap_command contains a NUL escape — fix it' || echo ok

Try / catch

if e.to_string().contains("bootstrap command contains NUL") {
    // sanitize the command string (strip \0) or retype it in the config
}

Prevention

When it happens

Trigger: A mise.toml bootstrap_command string containing an escaped NUL (TOML has no \0 escape, but "\u0000" is legal and produces the byte), a command generated by tooling that embeds raw NULs, or RemoteOverrides built from code that passes a string with an embedded \0 to `mise bootstrap remote --bootstrap-command`.

Common situations: Copy-pasting a command from a binary-safe source or terminal that introduced a control character; config generated by scripts that concatenate strings without sanitizing; YAML-to-TOML conversion tools emitting \u0000 placeholders.

Related errors


AI-assisted analysis of jdx/mise@9dcfcaa0dc (2026-08-17). Data as JSON: /api/errors/03e800c898c96455. Report an issue: GitHub.