{"record":{"id":"c89f4f1b9f5fe1ae","repo":"vectordotdev/vector","slug":"already-exists-for-release-new-version-delete-it-or-move-it","errorCode":null,"errorMessage":"{} already exists for release {new_version}. Delete it (or move it aside) and re-run.","messagePattern":"(.+?) already exists for release (.+?)\\. Delete it \\(or move it aside\\) and re-run\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/commands/release/generate_cue.rs","lineNumber":122,"sourceCode":"    // failure doesn't leave a partial CUE file behind (which would then trip the\n    // \"file already exists\" guard on the next run).\n    let cue_text = render_release_cue(&new_version, &changelog_entries);\n    let breaking: Vec<&BreakingDetails> = changelog_entries\n        .iter()\n        .filter_map(|e| e.breaking_details.as_ref())\n        .collect();\n    let highlights_md = if breaking.is_empty() {\n        None\n    } else {\n        // Guard against clobbering an existing upgrade guide for this release. We match on\n        // the version-suffix rather than the exact `today`-prefixed filename so a partial\n        // run from a previous UTC day (or a maintainer-authored guide dated earlier) is\n        // still detected. The single-page release layout would otherwise render two\n        // \"upgrade guide\" cards for the same release.\n        if let Some(existing) =\n            find_existing_upgrade_guide(&repo_root.join(HIGHLIGHTS_DIR), &new_version)?\n        {\n            bail!(\n                \"{} already exists for release {new_version}. Delete it (or move it aside) and re-run.\",\n                existing.display()\n            );\n        }\n        validate_breaking_anchors(&breaking)?;\n        Some(render_upgrade_guide(&today, &new_version, &breaking))\n    };\n\n    // Everything valid — commit the writes atomically via .tmp + rename.\n    atomic_write(&cue_path, &cue_text)?;\n    if let Some(md) = highlights_md {\n        if let Err(e) = atomic_write(&highlights_path, &md) {\n            // Highlights write failed after CUE succeeded — roll the CUE back so the next\n            // attempt doesn't hit the \"file already exists\" guard.\n            drop(fs::remove_file(&cue_path));\n            return Err(e);\n        }\n        success!(\"Wrote {}\", highlights_path.display());","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/vectordotdev/vector/blob/0d4ab78a4f0d9c9e5d03a50108a2ae4d2f4b2460/vdev/src/commands/release/generate_cue.rs#L104-L140","documentation":"The command detected an existing upgrade-guide/highlights file for the target release (found via `find_existing_upgrade_guide` which matches by release version across dated filenames) and aborts to avoid rendering two 'upgrade guide' cards for the same release in the single-page release layout.","triggerScenarios":"Running `vdev release generate-cue` with breaking changes when any file in the highlights directory matches `upgrade_guide_filename` for `new_version` — including a guide from a previous UTC day or a maintainer-authored guide dated earlier.","commonSituations":"Regenerating a release after the highlights file was already committed; a maintainer pre-wrote an upgrade guide by hand for the same version; the run spans a UTC date boundary so the dated filename differs but the version matches.","solutions":["Delete or move the existing highlights/upgrade-guide file identified in the message, then re-run.","If the existing guide is authoritative (hand-authored), keep it and remove whatever would cause regeneration of the highlights, or skip that part of the run.","Confirm the version argument matches the intended release; a wrong version can collide with an older guide."],"exampleFix":"// before\nvdev release generate-cue 0.46.0  # fails: 2026-09-14-upgrading-0.45-to-0.46.md exists\n// after\ngit rm website/content/en/highlights/2026-09-14-upgrading-0.45-to-0.46.md\nvdev release generate-cue 0.46.0","handlingStrategy":"validation","validationCode":"ls website/content/en/highlights/ | grep -- \"0.46\" || echo 'no guide for this release'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Search the highlights directory for the target version before running generation.","Coordinate with maintainers who may pre-author upgrade guides by hand.","Avoid running the command across UTC date boundaries without checking for previously dated guides."],"tags":["cli","release-tooling","file-conflict"],"backgroundTag":"file-already-exists","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"}