{"record":{"id":"619e1f105c5de031","repo":"vectordotdev/vector","slug":"cue-fmt-exited-with-status","errorCode":null,"errorMessage":"cue fmt exited with {status}","messagePattern":"cue fmt exited with (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/commands/release/generate_cue.rs","lineNumber":699,"sourceCode":"            if !e.pr_numbers.is_empty() {\n                let json_prs = serde_json::to_string(&e.pr_numbers).unwrap();\n                writeln!(s, \"\\t\\t\\tpr_numbers: {json_prs}\").unwrap();\n            }\n            if !e.contributors.is_empty() {\n                let json_contribs = serde_json::to_string(&e.contributors).unwrap();\n                writeln!(s, \"\\t\\t\\tcontributors: {json_contribs}\").unwrap();\n            }\n            s.push_str(\"\\t\\t}\");\n            s\n        })\n        .collect::<Vec<_>>()\n        .join(\",\\n\")\n}\n\nfn run_cue_fmt(path: &Path) -> Result<()> {\n    let status = Command::new(\"cue\").arg(\"fmt\").arg(path).status()?;\n    if !status.success() {\n        bail!(\"cue fmt exited with {status}\");\n    }\n    Ok(())\n}\n\n// ---------- Upgrade-guide (highlights) rendering ----------\n\n/// Return the first file in `highlights_dir` whose name ends in the version-suffix used\n/// by upgrade guides (e.g. `-0-58-0-upgrade-guide.md`), regardless of the date prefix.\nfn find_existing_upgrade_guide(\n    highlights_dir: &Path,\n    version: &Version,\n) -> Result<Option<PathBuf>> {\n    if !highlights_dir.is_dir() {\n        return Ok(None);\n    }\n    let suffix = format!(\n        \"-{}-{}-{}-upgrade-guide.md\",\n        version.major, version.minor, version.patch","sourceCodeStart":681,"sourceCodeEnd":717,"githubUrl":"https://github.com/vectordotdev/vector/blob/0d4ab78a4f0d9c9e5d03a50108a2ae4d2f4b2460/vdev/src/commands/release/generate_cue.rs#L681-L717","documentation":"`run_cue_fmt` shells out to the `cue` binary to format a generated CUE file and bails if the formatter exits non-zero. This means the cue toolchain is missing, crashed, or rejected the file path. The generated file may be left unformatted.","triggerScenarios":"`Command::new(\"cue\").arg(\"fmt\").arg(path).status()` returns a non-zero ExitStatus during `run` — e.g. the `cue` executable exists but fails on the target file (syntax error, permission issue on the path).","commonSituations":"An old or broken `cue` installation on PATH, a generated CUE file with invalid syntax handed to the formatter, or running in a container that lacks the cue binary.","solutions":["Check the cue toolchain: `cue version`; install or upgrade it (e.g. `go install cuelang.org/go/cmd/cue@latest`).","Manually run `cue fmt <path>` on the generated file to see the exact formatter error.","Inspect the generated CUE file for syntax problems if the formatter reports a parse error.","Re-run the vdev release command after fixing."],"exampleFix":"// before: cue missing/broken\n$ vdev release generate-cue\ncue fmt exited with exit status: 1\n// after: install a working cue\n$ go install cuelang.org/go/cmd/cue@latest\n$ cue version && vdev release generate-cue","handlingStrategy":"try-catch","validationCode":"command -v cue >/dev/null 2>&1 && cue version || echo \"cue is not installed or broken\"","typeGuard":null,"tryCatchPattern":"if let Err(e) = result {\n    if e.to_string().starts_with(\"cue fmt exited with\") {\n        eprintln!(\"cue toolchain problem: {e}; verify `cue version` and re-run `cue fmt <file>` manually\");\n    }\n}","preventionTips":["Pin the cue toolchain version used by release automation.","Run `cue version` as a preflight in CI jobs.","Format generated CUE content in-test before invoking the external binary."],"tags":["cue","subprocess","formatter","release-tooling"],"backgroundTag":"command-not-found","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"}