{"record":{"id":"5ec9beed1049cbec","repo":"elastic/elasticsearch","slug":"could-not-find-base-id-5ec9be","errorCode":null,"errorMessage":"Could not find base id: {}","messagePattern":"Could not find base id: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/GenerateTransportVersionDefinitionTask.java","lineNumber":164,"sourceCode":"    }\n\n    private void resetAllUpperBounds(TransportVersionResourcesService resources, Map<Integer, List<IdAndDefinition>> idsByBase)\n        throws IOException {\n        for (String upperBoundName : resources.getChangedUpperBoundNames()) {\n            TransportVersionUpperBound upstreamUpperBound = resources.getUpperBoundFromGitBase(upperBoundName);\n            resetUpperBound(resources, upstreamUpperBound, idsByBase, null);\n        }\n    }\n\n    private void resetUpperBound(\n        TransportVersionResourcesService resources,\n        TransportVersionUpperBound upperBound,\n        Map<Integer, List<IdAndDefinition>> idsByBase,\n        String ignoreDefinitionName\n    ) throws IOException {\n        List<IdAndDefinition> idsForUpperBound = idsByBase.get(upperBound.definitionId().base());\n        if (idsForUpperBound == null) {\n            throw new RuntimeException(\"Could not find base id: \" + upperBound.definitionId().base());\n        }\n        IdAndDefinition resetValue = idsForUpperBound.getLast();\n        if (resetValue.definition().name().equals(ignoreDefinitionName)) {\n            // there must be another definition in this base since the ignored definition is new\n            assert idsForUpperBound.size() >= 2;\n            resetValue = idsForUpperBound.get(idsForUpperBound.size() - 2);\n        }\n        var resetUpperBound = new TransportVersionUpperBound(upperBound.name(), resetValue.definition().name(), resetValue.id());\n        resources.writeUpperBound(resetUpperBound);\n    }\n\n    private void removeUnusedNamedDefinitions(\n        TransportVersionResourcesService resources,\n        Set<String> referencedNames,\n        Set<String> changedDefinitions\n    ) throws IOException {\n        for (String definitionName : changedDefinitions) {\n            if (referencedNames.contains(definitionName) == false) {","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/GenerateTransportVersionDefinitionTask.java#L146-L182","documentation":"RuntimeException from resetUpperBound() in GenerateTransportVersionDefinitionTask - identical invariant to error 309 but in the concrete task's private resetUpperBound helper. idsByBase.get(upperBound.definitionId().base()) returns null, meaning the base id referenced by the upper bound has no corresponding definitions.","triggerScenarios":"During the reset-all-upper-bounds pass, an upper bound's base does not appear as a key in idsByBase (built from current definitions), so there is no fallback definition to reset the bound to.","commonSituations":"Manually edited or partially-merged transport-version resources; a definition was removed but its upper-bound file still references the old base; concurrent modification of the resources directory.","solutions":["Open the upper-bound file named in the failure and note its definitionId().base().","Ensure a definition file exists that produces that base in idsByBase, or correct the upper-bound file.","Restore consistency from a known-good git revision of the transport-resources directory."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"List<IdAndDefinition> idsForUpperBound = idsByBase.get(upperBound.definitionId().base());\nif (idsForUpperBound == null) {\n    throw new IllegalStateException(\"Upper bound '\" + upperBound.name() + \"' references unknown base \" + upperBound.definitionId().base() + \"; available: \" + idsByBase.keySet());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep definition and upper-bound files consistent in the same commit.","Avoid manual edits to the transport-resources directory.","Re-run generation from a clean, synced checkout."],"tags":["transport-version","data-integrity","build-tooling","internal-invariant"],"backgroundTag":null,"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}