{"record":{"id":"9dbe9c006ce02003","repo":"vectordotdev/vector","slug":"on-latest-release-channel-and-tag-tag-is-different-from","errorCode":null,"errorMessage":"On latest release channel and tag {tag:?} is different from Cargo.toml {version:?}. Aborting","messagePattern":"On latest release channel and tag (.+?) is different from Cargo\\.toml (.+?)\\. Aborting","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/app.rs","lineNumber":60,"sourceCode":"\npub fn set_repo_dir() -> Result<()> {\n    env::set_current_dir(path()).context(\"Could not change directory\")\n}\n\npub fn version() -> Result<String> {\n    let mut version = utils::cargo::get_version()?;\n\n    let channel = utils::git::get_channel();\n\n    if channel == \"release\" {\n        let head = utils::git::git_head()?;\n        if !head.status.success() {\n            let error = String::from_utf8_lossy(&head.stderr);\n            bail!(\"Error running `git describe`:\\n{error}\");\n        }\n        let tag = String::from_utf8_lossy(&head.stdout).trim().to_string();\n        if tag != format!(\"v{version}\") {\n            bail!(\n                \"On latest release channel and tag {tag:?} is different from Cargo.toml {version:?}. Aborting\"\n            );\n        }\n\n    // extend version for custom builds if not already\n    } else if channel == \"custom\" && !version.contains(\"custom\") {\n        let sha = utils::git::get_git_sha()?;\n\n        // use '.' instead of '-' or '_' to avoid issues with rpm and deb package naming\n        // format requirements.\n        version = format!(\"{version}.custom.{sha}\");\n    }\n\n    Ok(version)\n}\n\n/// Overlay some extra helper functions onto `std::process::Command`\npub trait CommandExt {","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/vdev/src/app.rs#L42-L78","documentation":"vdev guards release builds: when the detected channel is \"release\", it compares the current `git describe` tag against the version declared in Cargo.toml. If the tag is not exactly \"v<CARGO_PKG_VERSION>\", it aborts with this message to prevent publishing a release whose git tag and crate version disagree.","triggerScenarios":"Running vdev's release/version command on a commit where HEAD's nearest tag differs from the Cargo.toml version (e.g. HEAD is at vX.Y.Z-2-gabc but Cargo.toml says 0.XY.0), or the tag was not updated after a version bump.","commonSituations":"Cutting a release from a branch that already moved past the tag; bumping Cargo.toml without tagging; tagging the wrong commit; running the release flow on main instead of the release commit.","solutions":["Tag the current HEAD with the exact version: `git tag v<version> && git push origin v<version>`, then rerun.","Checkout the exact release commit that carries the tag matching Cargo.toml before running vdev.","If Cargo.toml is wrong, update version = \"<tag-without-v>\" to match the tag and recommit.","Verify with `git describe --tags --exact-match` that HEAD is precisely on v<version> before releasing."],"exampleFix":"// before: Cargo.toml version 0.45.0 but HEAD tagged v0.44.2\ngit tag v0.45.0 && git push origin v0.45.0\n// after: describe --exact-match returns v0.45.0, vdev proceeds","handlingStrategy":"validation","validationCode":"# Verify tag/version consistency before running the release flow\nVERSION=$(grep -m1 '^version' Cargo.toml | sed 's/.*\"\\(.*\\)\"/\\1/')\nTAG=$(git describe --tags --exact-match 2>/dev/null || true)\n[ \"$TAG\" = \"v$VERSION\" ] || { echo \"tag $TAG != v$VERSION\"; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Tag the release commit immediately after the version-bump commit and push the tag.","Run `git describe --tags --exact-match` and compare with Cargo.toml before releasing.","Never release from commits ahead of the version tag; cut from the tagged commit.","Automate version bumps so Cargo.toml and the git tag are always updated together."],"tags":["git","versioning","release","cli"],"backgroundTag":"version-tag-mismatch","analyzedSha":"bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}