{"record":{"id":"0046a5077223597b","repo":"vectordotdev/vector","slug":"display-failed-exit","errorCode":null,"errorMessage":"`{display}` failed (exit {}):\n{}{}","messagePattern":"`(.+?)` failed \\(exit (.+?)\\):\n(.+?)(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/commands/release/generate_cue.rs","lineNumber":552,"sourceCode":"    Ok(())\n}\n\n#[cfg(test)]\nfn lookup_pull_requests(_: &Path, _: &Path, _: PullRequestMetadata) -> Result<Vec<u64>> {\n    // Unit tests exercise local parsing and rendering without requiring a Git repository.\n    Ok(vec![42])\n}\n\nfn run_command(cmd: &str, args: &[&str], cwd: &Path) -> Result<String> {\n    let display = format!(\"{cmd} {}\", args.join(\" \"));\n    let output = Command::new(cmd)\n        .args(args)\n        .current_dir(cwd)\n        .output()\n        .with_context(|| format!(\"Failed to run `{display}`\"))?;\n\n    if !output.status.success() {\n        bail!(\n            \"`{display}` failed (exit {}):\\n{}{}\",\n            output.status,\n            String::from_utf8_lossy(&output.stdout),\n            String::from_utf8_lossy(&output.stderr),\n        );\n    }\n\n    Ok(String::from_utf8_lossy(&output.stdout).into_owned())\n}\n\n/// Split off the trailing `authors: <handles...>` line, returning the body preceding it\n/// (as a slice into `raw`) plus the parsed handle list. Works with both LF and CRLF line\n/// endings — we locate the marker directly in the original byte stream rather than\n/// reconstructing offsets from `str::lines()`.\nfn split_authors(raw: &str) -> (&str, Vec<String>) {\n    let trimmed = raw.trim_end_matches(['\\n', '\\r']);\n    let (body_end, handles_start) = match trimmed.rfind(\"\\nauthors: \") {\n        Some(nl) => (nl, nl + 1),","sourceCodeStart":534,"sourceCodeEnd":570,"githubUrl":"https://github.com/vectordotdev/vector/blob/0d4ab78a4f0d9c9e5d03a50108a2ae4d2f4b2460/vdev/src/commands/release/generate_cue.rs#L534-L570","documentation":"This error is thrown by `run_command` in vdev's release CUE generation when an external shell command (git, gh, etc.) exits with a non-zero status. It wraps the command's exit status plus its captured stdout and stderr so the developer can see exactly why the subprocess failed. It is a generic subprocess-failure gate used throughout the release pipeline.","triggerScenarios":"Any command invoked via run_command (from lookup_pull_requests_from_git, ensure_full_git_history, pull_request_lookup_includes_renamed_fragment_commit, prepare_vector_version, pin_vrl_version, or append_vrl_changelog_to_release_cue) returns a non-zero exit code, e.g. `git fetch` fails, `gh pr list` is unauthenticated, or the GitHub API rate-limits.","commonSituations":"Running release preparation without `gh` authenticated (`gh auth login` missing), a shallow git clone so ensure_full_git_history must rewrite history, network outage or GitHub rate limiting during PR lookup, or a dirty/unexpected git state in the repo.","solutions":["Read the embedded stdout/stderr in the message to see the underlying command's failure reason.","Re-run the exact command manually in the repo root to reproduce and diagnose.","If it is a git command failure, check remote connectivity and that the clone is not shallow (git fetch --unshallow).","If it is a gh command failure, run `gh auth status` and authenticate with `gh auth login`.","Fix the underlying condition and re-run `vdev release generate-cue`."],"exampleFix":"// before: release script fails on shallow clone\n$ vdev release generate-cue\n`git log` failed (exit 128): fatal: your current branch 'master' does not have any commits yet\n// after: give git full history first\n$ git fetch --unshallow\n$ vdev release generate-cue","handlingStrategy":"try-catch","validationCode":"// before invoking release tooling, sanity-check prerequisites\nwhich git gh cue || echo \"missing tool\"\ngh auth status || gh auth login\ngit rev-parse --is-shallow-repository # must print false","typeGuard":null,"tryCatchPattern":"match run_result {\n    Err(e) if e.to_string().contains(\"failed (exit\") => {\n        eprintln!(\"subprocess failed: {e:#}; fix the command's stdout/stderr above and retry\");\n    }\n    Err(e) => return Err(e),\n    Ok(v) => v,\n}","preventionTips":["Authenticate gh (`gh auth login`) before any release script run.","Use full (non-shallow) clones in CI and locally.","Check network/API status before long release automations.","Always read the embedded stdout/stderr in the error message first."],"tags":["subprocess","git","cli","release-tooling"],"backgroundTag":"git-command-failed","analyzedSha":"0d4ab78a4f0d9c9e5d03a50108a2ae4d2f4b2460","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}