elastic/elasticsearch · critical · IllegalArgumentException
Could not parse any versions
Error message
Could not parse any versions
What it means
Thrown by the BwcVersions constructor when the parsed allVersions list is empty. BwcVersions parses Elasticsearch's Version.java to derive the wire/index-compatible version set used for backward-compatibility testing; an empty result means version parsing produced nothing.
Source
Thrown at build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BwcVersions.java:75
* E.x when M.N.c is released M.N.c+1 is added to the Version class mentioned above in all the following branches:
* `M.N`, and `main` so we can reliably assume that the leafs of the version tree are unreleased.
* This convention is enforced by checking the versions we consider to be unreleased against an
* authoritative source (maven central).
* We are then able to map the unreleased version to branches in git and Gradle projects that are capable of checking
* out and building them, so we can include these in the testing plan as well.
*/
public class BwcVersions implements Serializable {
private static final String GLIBC_VERSION_ENV_VAR = "GLIBC_VERSION";
private final Version currentVersion;
private final transient List<Version> versions;
private final Map<Version, UnreleasedVersionInfo> unreleased;
public BwcVersions(Version currentVersionProperty, List<Version> allVersions, List<DevelopmentBranch> developmentBranches) {
if (allVersions.isEmpty()) {
throw new IllegalArgumentException("Could not parse any versions");
}
this.versions = allVersions;
this.currentVersion = allVersions.get(allVersions.size() - 1);
assertCurrentVersionMatchesParsed(currentVersionProperty);
this.unreleased = computeUnreleased(developmentBranches);
}
private void assertCurrentVersionMatchesParsed(Version currentVersionProperty) {
if (currentVersionProperty.equals(currentVersion) == false) {
throw new IllegalStateException(
"Parsed versions latest version does not match the one configured in build properties. "
+ "Parsed latest version is "
+ currentVersion
+ " but the build has "
+ currentVersionProperty
);View on GitHub (pinned to db6a809a66)
Solutions
- Run from a complete, clean repository checkout.
- Ensure server/src/main/java/.../Version.java exists and matches the parser's expected declaration format.
- Regenerate or re-fetch version metadata.
- Check the build layout / root project configuration is correct.
Defensive patterns
Strategy: validation
Validate before calling
if (allVersions.isEmpty()) {
throw new IllegalArgumentException("Could not parse any versions");
} Prevention
- Run BWC builds from a complete, clean repository checkout.
- Keep Version.java's declaration format compatible with the parser.
- Add a CI guard that fails fast when version parsing yields an empty list.
When it happens
Trigger: The version-parsing routine that feeds allVersions returned an empty list - e.g. Version.java could not be located, its content did not match the expected declarations, or the source path was wrong.
Common situations: Running the build from a partial or corrupt checkout where Version.java is absent; a refactor of Version.java that broke the parser regex; wrong build root configuration.
Related errors
- Parsed versions latest version does not match the one config
- out-of-date released versions Following versions are not rea
- out-of-date released versions Build considers versions unrel
- Ran out of versions to go to for {}
- Unable to find build service with name '{}'.
AI-assisted analysis of elastic/elasticsearch@db6a809a66 (2026-08-12).
Data as JSON: /api/errors/2500bae2cb50039f.
Report an issue: GitHub.