jdx/mise · error

command output exceeded

Error message

command output exceeded {max_output_bytes} bytes

What it means

In execute_hashes_async (drain-timeout variant), mise consumes stdout/stderr chunks as HashedProcessOutput while hashing them, enforcing a caller-supplied max_output_bytes cap. If combined output exceeds the cap, it immediately bails with `command output exceeded {max_output_bytes} bytes`, aborting the command rather than buffering unbounded output.

Solutions

  1. Raise the max_output_bytes limit in the caller/configuration that invokes execute_hashes_async.
  2. Silence or reduce the command's output (e.g. redirect verbose logs to a file, use --quiet flags).
  3. Fix the command producing unexpected bulk output (diagnose what it prints).

Example fix

// before
let out = cmd.execute_hashes_async(max_output_bytes = 1_000_000).await?;
// after
let out = cmd.execute_hashes_async(50_000_000).await?;
// or quiet the command:
// run = "cargo build --quiet"
Defensive patterns

Strategy: try-catch

Validate before calling

test_out_size() { local s; s=$("$@" 2>&1 | wc -c); [ "$s" -lt 5000000 ]; }

Try / catch

match cmd.execute_hashes_async(limit).await {
  Err(e) if e.to_string().contains("command output exceeded") => {
    // rerun with output redirected to a file or a larger limit
  }
  r => r?,
}

Prevention

When it happens

Trigger: Running a command via execute_hashes_async where the sum of stdout+stderr bytes across chunks (saturating_add'ed) exceeds max_output_bytes — e.g. a tool emitting verbose logs or a dump to stdout during install/checksum verification.

Common situations: Build tools printing enormous logs; a command accidentally catting a large file; debug builds with verbose tracing enabled inside install hooks; runaway retry loops printing errors repeatedly.

Understand the failure class

Background: payload too large / request exceeds maximum size: why libraries cap bytes and how to fix oversize payloads — this error's family across 50 libraries.

Related errors


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

Appendix: source

Thrown at src/cmd.rs:1393

                            let _ = tx.send(HashedProcessOutput::ReadError("stderr", err)).await;
                            break;
                        }
                    }
                }
            });
        }
        drop(tx);

        let timeout_guard = self.timeout.map(|timeout| TimeoutGuard::new(timeout, id));
        let mut stdout_hasher = blake3::Hasher::new();
        let mut stderr_hasher = blake3::Hasher::new();
        let mut output_bytes = 0usize;
        let mut consume = |output: HashedProcessOutput| -> Result<()> {
            match output {
                HashedProcessOutput::Stdout(bytes) => {
                    output_bytes = output_bytes.saturating_add(bytes.len());
                    if output_bytes > max_output_bytes {
                        bail!("command output exceeded {max_output_bytes} bytes");
                    }
                    stdout_hasher.update(&bytes);
                }
                HashedProcessOutput::Stderr(bytes) => {
                    output_bytes = output_bytes.saturating_add(bytes.len());
                    if output_bytes > max_output_bytes {
                        bail!("command output exceeded {max_output_bytes} bytes");
                    }
                    stderr_hasher.update(&bytes);
                }
                HashedProcessOutput::ReadError(stream, err) => {
                    bail!("failed to read command {stream}: {err}");
                }
            }
            Ok(())
        };
        let mut status = None;
        let mut wait = Box::pin(cp.wait());

View on GitHub (pinned to 533346cc37)