vectordotdev/vector · error

On latest release channel and tag

Error message

On latest release channel and tag {tag:?} is different from Cargo.toml {version:?}. Aborting

What it means

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.

Solutions

  1. Tag the current HEAD with the exact version: `git tag v<version> && git push origin v<version>`, then rerun.
  2. Checkout the exact release commit that carries the tag matching Cargo.toml before running vdev.
  3. If Cargo.toml is wrong, update version = "<tag-without-v>" to match the tag and recommit.
  4. Verify with `git describe --tags --exact-match` that HEAD is precisely on v<version> before releasing.

Example fix

// before: Cargo.toml version 0.45.0 but HEAD tagged v0.44.2
git tag v0.45.0 && git push origin v0.45.0
// after: describe --exact-match returns v0.45.0, vdev proceeds
Defensive patterns

Strategy: validation

Validate before calling

# Verify tag/version consistency before running the release flow
VERSION=$(grep -m1 '^version' Cargo.toml | sed 's/.*"\(.*\)"/\1/')
TAG=$(git describe --tags --exact-match 2>/dev/null || true)
[ "$TAG" = "v$VERSION" ] || { echo "tag $TAG != v$VERSION"; exit 1; }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of vectordotdev/vector@bdb87aeaa4 (2026-09-16). Data as JSON: /api/errors/9dbe9c006ce02003. Report an issue: GitHub.

Appendix: source

Thrown at vdev/src/app.rs:60

pub fn set_repo_dir() -> Result<()> {
    env::set_current_dir(path()).context("Could not change directory")
}

pub fn version() -> Result<String> {
    let mut version = utils::cargo::get_version()?;

    let channel = utils::git::get_channel();

    if channel == "release" {
        let head = utils::git::git_head()?;
        if !head.status.success() {
            let error = String::from_utf8_lossy(&head.stderr);
            bail!("Error running `git describe`:\n{error}");
        }
        let tag = String::from_utf8_lossy(&head.stdout).trim().to_string();
        if tag != format!("v{version}") {
            bail!(
                "On latest release channel and tag {tag:?} is different from Cargo.toml {version:?}. Aborting"
            );
        }

    // extend version for custom builds if not already
    } else if channel == "custom" && !version.contains("custom") {
        let sha = utils::git::get_git_sha()?;

        // use '.' instead of '-' or '_' to avoid issues with rpm and deb package naming
        // format requirements.
        version = format!("{version}.custom.{sha}");
    }

    Ok(version)
}

/// Overlay some extra helper functions onto `std::process::Command`
pub trait CommandExt {

View on GitHub (pinned to bdb87aeaa4)