{"record":{"id":"834199260e2643bb","repo":"elastic/elasticsearch","slug":"parsed-versions-latest-version-does-not-match-the","errorCode":null,"errorMessage":"Parsed versions latest version does not match the one configured in build properties. Parsed latest version is {} but the build has {}","messagePattern":"Parsed versions latest version does not match the one configured in build properties\\. Parsed latest version is (.+?) but the build has (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"critical","filePath":"build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BwcVersions.java","lineNumber":87,"sourceCode":"    private final Version currentVersion;\n    private final transient List<Version> versions;\n    private final Map<Version, UnreleasedVersionInfo> unreleased;\n\n    public BwcVersions(Version currentVersionProperty, List<Version> allVersions, List<DevelopmentBranch> developmentBranches) {\n        if (allVersions.isEmpty()) {\n            throw new IllegalArgumentException(\"Could not parse any versions\");\n        }\n\n        this.versions = allVersions;\n        this.currentVersion = allVersions.get(allVersions.size() - 1);\n        assertCurrentVersionMatchesParsed(currentVersionProperty);\n\n        this.unreleased = computeUnreleased(developmentBranches);\n    }\n\n    private void assertCurrentVersionMatchesParsed(Version currentVersionProperty) {\n        if (currentVersionProperty.equals(currentVersion) == false) {\n            throw new IllegalStateException(\n                \"Parsed versions latest version does not match the one configured in build properties. \"\n                    + \"Parsed latest version is \"\n                    + currentVersion\n                    + \" but the build has \"\n                    + currentVersionProperty\n            );\n        }\n    }\n\n    /**\n     * Returns info about the unreleased version, or {@code null} if the version is released.\n     */\n    public UnreleasedVersionInfo unreleasedInfo(Version version) {\n        return unreleased.get(version);\n    }\n\n    public void forPreviousUnreleased(Consumer<UnreleasedVersionInfo> consumer) {\n        getUnreleased().stream().filter(version -> version.equals(currentVersion) == false).map(unreleased::get).forEach(consumer);","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BwcVersions.java#L69-L105","documentation":"Thrown by BwcVersions.assertCurrentVersionMatchesParsed when the last entry in the parsed version list does not equal the Version.CURRENT configured in build properties. The build's notion of the current version must agree with the latest parsed version; a mismatch indicates an inconsistent version bump.","triggerScenarios":"Version.java CURRENT was updated to a new number but the parsed version list's last entry (or vice versa) was not updated to match - one source of truth changed, the other did not.","commonSituations":"Half-finished version bump across branches; merging a version change without the corresponding metadata update; branch switched but stale build cache.","solutions":["Update Version.java CURRENT to match the parsed latest version.","Re-run the version-metadata generation task after a version bump.","Clean the build cache and rebuild so parsing re-runs.","Verify you are on the intended branch with a consistent version set."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (currentVersionProperty.equals(currentVersion) == false) {\n    throw new IllegalStateException(\"Parsed latest \" + currentVersion + \" != configured \" + currentVersionProperty);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bump Version.java CURRENT and version metadata together in the same commit.","Clean build caches after a version change so parsing re-runs.","Add a pre-merge check that asserts the parsed latest equals the configured current."],"tags":["bwc","versioning","configuration-time","build-tools"],"backgroundTag":null,"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}