elastic/elasticsearch · critical · IllegalStateException
out-of-date released versions Build considers versions unrel
Error message
out-of-date released versions
Build considers versions unreleased, but they are released according to an authoritative source: {}
The next versions probably needs to be added to Version.java (CURRENT doesn't count). What it means
Thrown by BwcVersions.compareToAuthoritative when the authoritative source considers versions released that the build still treats as unreleased. Per the project convention, when a version ships the next version must be added to Version.java; this error says that follow-up was missed.
Source
Thrown at build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BwcVersions.java:190
)
);
}
public void compareToAuthoritative(List<Version> authoritativeReleasedVersions) {
Set<Version> notReallyReleased = new HashSet<>(getReleased());
notReallyReleased.removeAll(authoritativeReleasedVersions);
if (notReallyReleased.isEmpty() == false) {
throw new IllegalStateException(
"out-of-date released versions"
+ "\nFollowing versions are not really released, but the build thinks they are: "
+ notReallyReleased
);
}
Set<Version> incorrectlyConsideredUnreleased = new HashSet<>(authoritativeReleasedVersions);
incorrectlyConsideredUnreleased.retainAll(getUnreleased());
if (incorrectlyConsideredUnreleased.isEmpty() == false) {
throw new IllegalStateException(
"out-of-date released versions"
+ "\nBuild considers versions unreleased, "
+ "but they are released according to an authoritative source: "
+ incorrectlyConsideredUnreleased
+ "\nThe next versions probably needs to be added to Version.java (CURRENT doesn't count)."
);
}
}
public List<Version> getReleased() {
return versions.stream()
.filter(v -> v.getMajor() >= currentVersion.getMajor() - 1)
.filter(v -> unreleased.containsKey(v) == false)
.toList();
}
public List<Version> getReadOnlyIndexCompatible() {
// Lucene can read indices in version N-2View on GitHub (pinned to db6a809a66)
Solutions
- Add the next unreleased version to Version.java as the message instructs (CURRENT does not count).
- Mark the now-released version as released in build metadata.
- Pull the latest from the release branch and re-run the version sanity check.
Defensive patterns
Strategy: validation
Validate before calling
Set<Version> wrong = new HashSet<>(authoritativeReleasedVersions);
wrong.retainAll(getUnreleased());
if (wrong.isEmpty() == false) {
throw new IllegalStateException("Add next version to Version.java: " + wrong);
} Prevention
- Immediately after a release, add the successor version to Version.java.
- Run the version-sanity check in CI against authoritative Maven Central data.
- Treat the release-merge as incomplete until the successor version lands.
When it happens
Trigger: A version was published to Maven Central but Version.java (and the derived unreleased set) was never updated to add the successor version, so the build still lists a now-released version as unreleased.
Common situations: Release completed but the repository's Version.java was not updated; merge of the release branch omitted the version-metadata follow-up.
Related errors
- out-of-date released versions Following versions are not rea
- Could not parse any versions
- Parsed versions latest version does not match the one config
- Ran out of versions to go to for {}
- System property 'bwc.throttle.maxParallelUsages' must be >=
AI-assisted analysis of elastic/elasticsearch@db6a809a66 (2026-08-12).
Data as JSON: /api/errors/55616c1f8153c258.
Report an issue: GitHub.