a-b-street/abstreet · error
Failed to run
Error message
Failed to run {:?}: {:?} What it means
In must_run_cmd, when cmd.status() itself returns Err (the process could not be spawned at all — executable not on PATH, permission denied, etc.), it panics with "Failed to run {cmd:?}: {err}". Unlike error 11, the command never executed; this is a spawn failure.
Solutions
- Install the missing executable (e.g. apt install osmium-tool) or build the repo's own binary the command refers to.
- Check that the executable name is on PATH: `which <cmd>`; extend PATH in CI/cron environments.
- Verify the file has the execute permission bit set (chmod +x).
- Use Command::spawn/status with a match on io::Error if you want a graceful fallback to a different tool.
Example fix
// before
abstutil::must_run_cmd(&mut Command::new("osmium"));
// after
if which::which("osmium").is_err() {
eprintln!("osmium not installed; skipping extract step");
return;
}
abstutil::must_run_cmd(&mut Command::new("osmium")); Defensive patterns
Strategy: validation
Validate before calling
use std::process::Command;
let exe = cmd.get_program().to_string_lossy();
assert!(which::which(&*exe).is_ok(), "executable '{}' not on PATH", exe); Try / catch
// Panics uncatchably; guard the spawn yourself:
if let Err(e) = cmd.status() {
eprintln!("could not spawn {}: {}", cmd.get_program().to_string_lossy(), e);
return;
} Prevention
- Install required tools (osmium-tool, wget, etc.) and verify with `which` in setup scripts.
- Set PATH explicitly in CI/cron/container environments.
- Ensure built helper binaries have the execute bit and match the target platform.
When it happens
Trigger: Calling abstutil::must_run_cmd where the executable does not exist or isn't on PATH, lacks the execute bit, or the OS refuses to fork/exec the process.
Common situations: Tool like osmium or wget not installed on the machine; PATH not set in cron/CI environments; the binary exists but isn't executable; running in a slim container missing the dependency.
Related errors
- failed
- This build of A/B Street stores player data in…
- Can't find the data/ directory
- CityName::new( , ) has a country code that isn't two letters
- Couldn't read_json( )
AI-assisted analysis of a-b-street/abstreet@0964f29315 (2026-09-13).
Data as JSON: /api/errors/fbb36f14fb4fa9ea.
Report an issue: GitHub.
Appendix: source
Thrown at abstutil/src/process.rs:13
use std::process::Command;
/// Runs a command, asserts success. STDOUT and STDERR aren't touched.
pub fn must_run_cmd(cmd: &mut Command) {
println!("- Running {:?}", cmd);
match cmd.status() {
Ok(status) => {
if !status.success() {
panic!("{:?} failed", cmd);
}
}
Err(err) => {
panic!("Failed to run {:?}: {:?}", cmd, err);
}
}
}
View on GitHub (pinned to 0964f29315)