elastic/elasticsearch · error · RuntimeException
Could not find base id: {}
Error message
Could not find base id: {} What it means
RuntimeException from resetUpperBounds() in AbstractGenerateTransportVersionDefinitionTask when the idsByBase map has no entry for upperBound.definitionId().base(). This indicates an internal invariant violation: an upper bound references a base id that no definition populated.
Source
Thrown at build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/AbstractGenerateTransportVersionDefinitionTask.java:153
} else if (resources.getChangedUpperBoundNames().contains(upperBoundName)) {
// Default case: we're not targeting this branch so reset it
resetUpperBound(resources, existingUpperBound, idsByBase, definitionName);
}
}
Collections.sort(ids);
return ids;
}
private void resetUpperBound(
TransportVersionResourcesService resources,
TransportVersionUpperBound upperBound,
Map<Integer, List<IdAndDefinition>> idsByBase,
String ignoreDefinitionName
) throws IOException {
List<IdAndDefinition> idsForUpperBound = idsByBase.get(upperBound.definitionId().base());
if (idsForUpperBound == null) {
throw new RuntimeException("Could not find base id: " + upperBound.definitionId().base());
}
IdAndDefinition resetValue = idsForUpperBound.getLast();
if (resetValue.definition().name().equals(ignoreDefinitionName)) {
// there must be another definition in this base since the ignored definition is new
assert idsForUpperBound.size() >= 2;
resetValue = idsForUpperBound.get(idsForUpperBound.size() - 2);
}
var resetUpperBound = new TransportVersionUpperBound(upperBound.name(), resetValue.definition().name(), resetValue.id());
resources.writeUpperBound(resetUpperBound);
}
private TransportVersionId maybeGetExistingId(
TransportVersionUpperBound upperBound,
TransportVersionDefinition existingDefinition,
String name
) {
if (existingDefinition == null) {
// the name doesn't yet exist, so there is no id to returnView on GitHub (pinned to db6a809a66)
Solutions
- Inspect the upper-bound file referenced and its definitionId().base() value.
- Cross-check that base against the definition files that populate idsByBase (look for a definition with that base).
- Restore the missing definition from git, or remove the orphaned upper-bound entry.
- Re-run on a clean checkout of the transport-version resources directory.
Defensive patterns
Strategy: validation
Validate before calling
List<IdAndDefinition> idsForUpperBound = idsByBase.get(upperBound.definitionId().base());
if (idsForUpperBound == null) {
throw new IllegalStateException("Upper bound '" + upperBound.name() + "' references unknown base " + upperBound.definitionId().base() + "; available bases: " + idsByBase.keySet());
} Prevention
- Never hand-edit transport-version resource files; use the generator tasks.
- Keep upper-bound and definition files in the same commit to avoid drift.
- Run generation from a clean checkout to avoid partial states.
When it happens
Trigger: The transport-version resource files are inconsistent - an upper-bound CSV references a base number that does not appear as a key in idsByBase, which is built from existing definitions.
Common situations: Manually edited transport-version resource files; a partial merge/rebase leaving an upper bound pointing at a deleted definition; corruption from a concurrent run writing to the resources dir.
Related errors
- Could not find base id: {}
- Failed to parse id {} in {}
- Invalid transport version data file [{}]: {}
- Invalid transport version upper bound file [{}]: {}
- Invalid increment {}, must be a positive integer
AI-assisted analysis of elastic/elasticsearch@db6a809a66 (2026-08-12).
Data as JSON: /api/errors/d59634434db54702.
Report an issue: GitHub.