{"record":{"id":"5354d83faa8a57fb","repo":"zed-industries/zed","slug":"command-failed-with-status","errorCode":null,"errorMessage":"Command failed with status {}","messagePattern":"Command failed with status (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"tooling/xtask/src/tasks/gpui.rs","lineNumber":354,"sourceCode":"            .collect::<Vec<_>>()\n            .join(\" \");\n\n        if args.is_empty() {\n            program.to_string()\n        } else {\n            format!(\"{} {}\", program, args)\n        }\n    };\n    eprintln!(\"+ {}\", command_str);\n\n    let output = command\n        .spawn()\n        .context(\"failed to spawn child process\")?\n        .wait_with_output()\n        .context(\"failed to wait for child process\")?;\n\n    if !output.status.success() {\n        bail!(\"Command failed with status {}\", output.status);\n    }\n\n    Ok(output)\n}\n\n#[cfg(test)]\nmod tests {\n    use indoc::indoc;\n\n    use super::*;\n\n    #[test]\n    fn test_update_dependency_version_in_toml() {\n        let input = indoc! {r#\"\n            [workspace]\n            resolver = \"2\"\n\n            [workspace.dependencies]","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/zed-industries/zed/blob/916fc2b8cb3a815cbef4a3b40e13081be72036b6/tooling/xtask/src/tasks/gpui.rs#L336-L372","documentation":"run_command in the GPUI publish xtask spawns an external process and bails with this generic error whenever the child exits non-zero. The error only carries the exit status, not stderr, so the caller must infer which command failed from the `+ <command>` line echoed just before execution. It is the common failure funnel for every git/cargo step of publish-gpui.","triggerScenarios":"Any Command passed to run_command exits with a non-zero status: `git status` failing (e.g. not a git repo), `cargo publish` failing (auth token invalid, version already exists, network error), or similar subcommands in the publish pipeline.","commonSituations":"Publishing from a directory without git metadata; crates.io token expired or missing (`CARGO_REGISTRY_TOKEN`); version already published (409); offline CI environment blocking network access.","solutions":["Read the `+ <command>` line above the error to identify which child process failed and re-run it manually to see stderr","For cargo publish failures, run `cargo login` or set a valid CARGO_REGISTRY_TOKEN","If the version already exists on crates.io, bump the version in Cargo.toml and retry","Check network/registry availability (https://crates.io) and proxy settings"],"exampleFix":"// before\nbail!(\"Command failed with status {}\", output.status);\n\n// after (include stderr for diagnosis)\nbail!(\n    \"Command failed with status {}: {}\",\n    output.status,\n    String::from_utf8_lossy(&output.stderr)\n);","handlingStrategy":"try-catch","validationCode":"// verify prerequisites before invoking xtask\ngit rev-parse --is-inside-work-tree\ncargo --version\necho -n \"$CARGO_REGISTRY_TOKEN\" | grep -q . || echo \"registry token missing\"","typeGuard":null,"tryCatchPattern":"match xtask_publish().context(\"publish-gpui failed\") {\n    Ok(()) => println!(\"published\"),\n    Err(e) if e.to_string().contains(\"Command failed with status\") => {\n        eprintln!(\"A pipeline step failed; inspect the '+ <command>' line above: {e:#}\")\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Always run release tooling with output visible so the echoed `+ <command>` identifies the failing step","Validate cargo credentials (`cargo login` state) before publishing","Bump versions before running publish to avoid crates.io already-published errors","Run commands from the workspace root inside a valid git checkout"],"tags":["cli","subprocess","publishing"],"backgroundTag":"command-not-found","analyzedSha":"916fc2b8cb3a815cbef4a3b40e13081be72036b6","analyzedAt":"2026-09-19T19:09:50.599Z","contentChangedAt":"2026-09-19T19:09:50.599Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}