jdx/mise · error

remote mise candidate discovery returned a truncated…

Error message

remote mise candidate discovery returned a truncated response

What it means

When mise discovers mise executables on a remote host it runs a shell script that emits each candidate path followed by a NUL byte (\0). After collecting the output, parse_remote_mise_candidates requires that non-empty output end with a NUL terminator; if it does not, the response was cut off mid-write (partial command output, connection drop, or interleaved output) and the candidate list cannot be trusted, so this error is thrown.

Solutions

  1. Re-run the operation; transient SSH truncation usually resolves on retry
  2. Verify the SSH connection is stable (no proxy/timeout dropping the session mid-output)
  3. Ensure no wrapper around the remote shell (e.g. motd scripts, rc files printing partial output) interferes with NUL-delimited output
  4. Set remote_mise or mise_bin explicitly to skip candidate discovery entirely

Example fix

// before (implicit discovery over unstable link)
let mise = system.remote_mise()?;
// after
let mise = system.remote_mise().with_config(RemoteConfig::new().mise_bin("/usr/local/bin/mise"))?;
Defensive patterns

Strategy: retry

Validate before calling

let out = ssh_output; if !out.is_empty() && !out.ends_with('\0') { /* treat as truncated, retry */ }

Type guard

fn is_complete_candidate_output(output: &str) -> bool { output.is_empty() || output.ends_with('\0') }

Try / catch

match result { Err(e) if e.to_string().contains("truncated response") => retry_with_backoff(3), Err(e) => return Err(e), Ok(v) => v }

Prevention

When it happens

Trigger: Calling remote mise candidate discovery (which runs remote_mise_candidates_script over SSH) when the remote shell output is truncated: the SSH session closes mid-command, output buffering drops the final NUL, or another process wrote a partial candidate entry.

Common situations: Flaky SSH connections to remote hosts; remote shells with output limits (ulimit/stty) that truncate command output; proxies or wrappers around SSH that mangle binary-safe NUL-delimited output; very slow remote hosts where the session times out during discovery.

Related errors


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

Appendix: source

Thrown at src/system/remote.rs:1319

  case "$1" in
    /*) if [ -x "$1" ]; then printf '%s\000' "$1"; fi ;;
  esac
}
old_ifs=$IFS
IFS=:
for directory in $PATH; do
  if [ -z "$directory" ]; then directory=.; fi
  emit_mise_candidate "$directory/mise"
done
IFS=$old_ifs
for candidate in "$HOME/.local/bin/mise" "$HOME/.local/share/mise/bin/mise" "$HOME/.cargo/bin/mise" /usr/local/bin/mise /opt/homebrew/bin/mise; do
  emit_mise_candidate "$candidate"
done"#
}

fn parse_remote_mise_candidates(output: &str) -> Result<Vec<String>> {
    if !output.is_empty() && !output.ends_with('\0') {
        bail!("remote mise candidate discovery returned a truncated response");
    }
    output
        .split_terminator('\0')
        .map(validated_remote_command)
        .collect::<Result<IndexSet<_>>>()
        .map(IndexSet::into_iter)
        .map(Iterator::collect)
}

#[derive(Clone, Debug, Eq, PartialEq)]
struct RemoteMiseIdentity {
    version: String,
    fingerprint: String,
}

async fn remote_mise_candidate_identities(
    session: &SshSession<'_>,
    candidates: &[String],

View on GitHub (pinned to 533346cc37)