a-b-street/abstreet · error
failed
Error message
{:?} failed What it means
must_run_cmd runs an external command and asserts it exits successfully. If cmd.status() returns Ok but the exit status indicates failure (non-zero exit code or signal), it panics with "{cmd:?} failed". It is the strict wrapper used by download, osmium, upload, and incremental_upload to abort import/deploy pipelines when a subprocess fails.
Solutions
- Run the wrapped command manually with the same arguments to see its real error output (must_run_cmd doesn't capture stdout/stderr, so the subprocess's own message was printed).
- Fix the input data / flags that made the subprocess exit non-zero (bad URL, corrupt file, wrong paths).
- Check network connectivity and credentials for download/upload commands.
- If failure should be tolerated, use Command::status() directly and match on the ExitStatus instead of must_run_cmd.
Example fix
// before
abstutil::must_run_cmd(&mut Command::new("osmium").args(&["extract", bad_input]));
// after
let status = Command::new("osmium").args(&["extract", bad_input]).status()?;
if !status.success() {
eprintln!("osmium failed with {:?}; continuing anyway", status);
} Defensive patterns
Strategy: try-catch
Validate before calling
// Cannot catch a panic; verify preconditions first:
assert!(which::which("osmium").is_ok(), "osmium not on PATH"); Try / catch
// Replace with manual status handling:
match cmd.status() {
Ok(s) if s.success() => {},
Ok(s) => eprintln!("command exited with {:?}", s.code()),
Err(e) => eprintln!("spawn failed: {}", e),
} Prevention
- Test wrapped commands manually with identical arguments before automating.
- Capture and log subprocess stdout/stderr for diagnostics.
- Validate input files (URLs reachable, OSM extracts valid) before invoking osmium/download.
When it happens
Trigger: Calling abstutil::must_run_cmd with a command that runs but exits non-zero — e.g. a download tool failing, osmium rejecting a bad OSM extract, git/upload commands failing due to remote errors.
Common situations: OSM data URL changed so wget/curl fails; osmium invoked on corrupt/unsupported PBF input; upload target rejects credentials; missing network causing any subprocess to fail; wrong CLI flags passed to the wrapped tool.
Related errors
- Failed to run
- 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/6ee463f94e80a03e.
Report an issue: GitHub.
Appendix: source
Thrown at abstutil/src/process.rs:9
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)