{"record":{"id":"2500bae2cb50039f","repo":"elastic/elasticsearch","slug":"could-not-parse-any-versions","errorCode":null,"errorMessage":"Could not parse any versions","messagePattern":"Could not parse any versions","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"critical","filePath":"build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BwcVersions.java","lineNumber":75,"sourceCode":" * 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:\n *  `M.N`, and `main` so we can reliably assume that the leafs of the version tree are unreleased.\n * This convention is enforced by checking the versions we consider to be unreleased against an\n * authoritative source (maven central).\n * We are then able to map the unreleased version to branches in git and Gradle projects that are capable of checking\n * out and building them, so we can include these in the testing plan as well.\n */\n\npublic class BwcVersions implements Serializable {\n\n    private static final String GLIBC_VERSION_ENV_VAR = \"GLIBC_VERSION\";\n\n    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            );","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BwcVersions.java#L57-L93","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (allVersions.isEmpty()) {\n    throw new IllegalArgumentException(\"Could not parse any versions\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["bwc","versioning","configuration-time","build-tools"],"backgroundTag":null,"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}