elastic/elasticsearch · critical · IllegalStateException

out-of-date released versions Following versions are not rea

Error message

out-of-date released versions
Following versions are not really released, but the build thinks they are: {}

What it means

Thrown by BwcVersions.compareToAuthoritative when the build's released-version set contains versions that the authoritative source (Maven Central) does NOT consider released. In other words, the build is optimistically marking as released something that has not actually shipped.

Source

Thrown at build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BwcVersions.java:180

            .isPresent()
                ? Optional.empty()
                : getReleased().stream()
                    .filter(v -> v.getMajor() == currentVersion.getMajor() - 1)
                    .min(Comparator.reverseOrder())
                    .map(
                        version -> new UnreleasedVersionInfo(
                            version,
                            String.format("%d.%d", version.getMajor(), version.getMinor()),
                            ":distribution:bwc:major1"
                        )
                    );
    }

    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)."
            );
        }
    }

View on GitHub (pinned to db6a809a66)

Solutions

  1. Move the offending version back to the unreleased set in build metadata until it actually ships.
  2. Re-run against an updated authoritative source (refresh Maven Central metadata).
  3. Coordinate the metadata change with the actual release publication.
Defensive patterns

Strategy: validation

Validate before calling

Set<Version> notReallyReleased = new HashSet<>(getReleased());
notReallyReleased.removeAll(authoritativeReleasedVersions);
if (notReallyReleased.isEmpty() == false) {
    throw new IllegalStateException("out-of-date released versions: " + notReallyReleased);
}

Prevention

When it happens

Trigger: A version was added to the released set in build metadata before it was actually published to Maven Central; compareToAuthoritative runs during the version sanity check and finds the discrepancy.

Common situations: Premature version bump in build metadata; release pipeline partially completed; metadata updated on a branch ahead of the actual release.

Related errors


AI-assisted analysis of elastic/elasticsearch@db6a809a66 (2026-08-12). Data as JSON: /api/errors/338b02dd18a9f629. Report an issue: GitHub.