elastic/elasticsearch · error · IllegalArgumentException
No version tags specified
Error message
No version tags specified
What it means
Thrown by TagVersionsTask.executeTask() when tagVersions is empty after releaseVersion is already validated. The --tag-version option (form <VersionType>:<id>) was not supplied, so there is nothing to record.
Source
Thrown at build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/release/TagVersionsTask.java:60
}
@Option(option = "release", description = "The release version to be tagged")
public void release(String version) {
releaseVersion = Version.fromString(version);
}
@Option(option = "tag-version", description = "Version id to tag. Of the form <VersionType>:<id>.")
public void tagVersions(List<String> version) {
this.tagVersions = splitVersionIds(version);
}
@TaskAction
public void executeTask() throws IOException {
if (releaseVersion == null) {
throw new IllegalArgumentException("Release version not specified");
}
if (tagVersions.isEmpty()) {
throw new IllegalArgumentException("No version tags specified");
}
LOGGER.lifecycle("Tagging version {} component ids", releaseVersion);
var versions = expandV7Version(tagVersions);
for (var v : versions.entrySet()) {
Path recordFile = switch (v.getKey()) {
case INDEX_VERSION_TYPE -> rootDir.resolve(INDEX_VERSIONS_RECORD);
default -> throw new IllegalArgumentException("Unknown version type " + v.getKey());
};
LOGGER.lifecycle("Adding version record for {} to [{}]: [{},{}]", v.getKey(), recordFile, releaseVersion, v.getValue());
Path file = rootDir.resolve(recordFile);
List<String> versionRecords = Files.readAllLines(file);
var modified = addVersionRecord(versionRecords, releaseVersion, v.getValue());
if (modified.isPresent()) {View on GitHub (pinned to db6a809a66)
Solutions
- Supply --tag-version in <VersionType>:<id> form, e.g. --tag-version=Index:42.
- Confirm splitVersionIds() is not stripping the input; verify the option value is non-empty in the release script.
Example fix
// before ./gradlew tagVersions --release=8.10.0 // after ./gradlew tagVersions --release=8.10.0 --tag-version=Index:42
Defensive patterns
Strategy: validation
Validate before calling
// Validate tag-version presence before running
tasks.named('tagVersions').configure(t -> t.doFirst(spec -> {
if (!spec.getProviders().gradleProperty("tag-version").isPresent()) {
throw new GradleException("--tag-version=<Type>:<id> is required");
}
})); Prevention
- Template the tagVersions invocation to always include both --release and --tag-version.
- Fail fast in CI when either is missing.
When it happens
Trigger: Running tagVersions with --release but omitting --tag-version, or passing a --tag-version list that splitVersionIds() reduced to empty.
Common situations: Operator forgets the tag-version argument in the release command; the option value is templated from a variable that resolved empty.
Related errors
- Release version not specified
- At least one of add-branch, remove-branch or update-branch m
- No versions to add or remove specified
- Unknown version type {key}
- Expected branch and version in format <branch>:<version>
AI-assisted analysis of elastic/elasticsearch@db6a809a66 (2026-08-12).
Data as JSON: /api/errors/96fe47cb272d27b7.
Report an issue: GitHub.