{"record":{"id":"ffad09ffa17781be","repo":"rust-lang/rust-analyzer","slug":"failed","errorCode":null,"errorMessage":"{:?} failed, {}","messagePattern":"(.+?) failed, (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/project-model/src/lib.rs","lineNumber":220,"sourceCode":"            | ProjectManifest::CargoScript(it) => it,\n        }\n    }\n}\n\nimpl fmt::Display for ProjectManifest {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        fmt::Display::fmt(self.manifest_path(), f)\n    }\n}\n\nfn utf8_stdout(cmd: &mut Command) -> anyhow::Result<String> {\n    let output = cmd.output().with_context(|| format!(\"{cmd:?} failed\"))?;\n    if !output.status.success() {\n        match String::from_utf8(output.stderr) {\n            Ok(stderr) if !stderr.is_empty() => {\n                bail!(\"{:?} failed, {}\\nstderr:\\n{}\", cmd, output.status, stderr)\n            }\n            _ => bail!(\"{:?} failed, {}\", cmd, output.status),\n        }\n    }\n    let stdout = String::from_utf8(output.stdout)?;\n    Ok(stdout.trim().to_owned())\n}\n\n#[derive(Clone, Debug, Default, PartialEq, Eq)]\npub enum InvocationStrategy {\n    Once,\n    #[default]\n    PerWorkspace,\n}\n\n/// A set of cfg-overrides per crate.\n#[derive(Default, Debug, Clone, Eq, PartialEq)]\npub struct CfgOverrides {\n    /// A global set of overrides matching all crates.\n    pub global: cfg::CfgDiff,","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/rust-lang/rust-analyzer/blob/e8f7e90aa3e7b26aa9a000200f606c1078da99ec/crates/project-model/src/lib.rs#L202-L238","documentation":"utf8_stdout's fallback bail: the command exited non-zero but no usable stderr was captured (empty stderr or invalid UTF-8). It reports only the command and exit status, so the cause must be inferred from the command itself. Same family as the stderr variant but with no diagnostic output attached.","triggerScenarios":"utf8_stdout running a command that exits non-zero with empty or non-UTF-8 stderr — e.g. `rustc --print sysroot` when rustc is absent from PATH, killed by a signal, or emitting binary garbage on stderr.","commonSituations":"rustc/cargo not on PATH (broken environment); command killed (OOM/signal) producing no stderr; locale/encoding issues making stderr non-UTF-8; wrapper scripts exiting silently.","solutions":["Check that `rustc`/`cargo`/`rustup` are installed and on PATH (`which rustc; rustc --version`).","Re-run the exact command from the message manually to reproduce and see any output.","Fix environment variables (PATH, RUSTUP_HOME, CARGO_HOME, RUSTUP_TOOLCHAIN) that may point at broken installs.","If the process is being killed, check memory/disk resources."],"exampleFix":"// before\n$ echo $PATH   # rustc not present\n// after\n$ rustup default stable\n$ export PATH=\"$HOME/.cargo/bin:$PATH\"\n$ rustc --version","handlingStrategy":"retry","validationCode":"let ok = Command::new(\"rustc\").arg(\"--version\").output()\n    .map(|o| o.status.success() && !o.stdout.is_empty())\n    .unwrap_or(false);\nif !ok { /* repair toolchain / PATH before invoking library code */ }","typeGuard":null,"tryCatchPattern":"// no stderr is attached, so retry after fixing the environment\nmatch result {\n    Err(e) if e.to_string().contains(\"failed, exit status\") => {\n        // re-check PATH/toolchain, then retry once\n        retry_after_env_fix()\n    }\n    other => other,\n}","preventionTips":["Verify the executable exists on PATH before running.","Check for signal kills (OOM) if the failure is intermittent.","Ensure stderr encoding issues (locales, wrappers) are excluded from the toolchain commands.","Log the exact command from the message and run it manually to debug."],"tags":["toolchain","rustup","rustc","process-failure"],"backgroundTag":"toolchain-command-failed","analyzedSha":"e8f7e90aa3e7b26aa9a000200f606c1078da99ec","analyzedAt":"2026-09-03T21:08:06.959Z","contentChangedAt":"2026-09-03T21:08:06.959Z","schemaVersion":2},"datasetVersion":"2026-09-11T07:07:21.782Z"}