{"record":{"id":"d6e3e0842ed1eae1","repo":"elastic/elasticsearch","slug":"missing-upper-bound-for-stack-version","errorCode":null,"errorMessage":"Missing upper bound {} for stack version {}","messagePattern":"Missing upper bound (.+?) for stack version (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/UpdateTransportVersionsCSVTask.java","lineNumber":46,"sourceCode":"    @ServiceReference(\"transportVersionResources\")\n    abstract Property<TransportVersionResourcesService> getResourceService();\n\n    @InputFile\n    public abstract RegularFileProperty getTransportVersionsFile();\n\n    @Input\n    @Option(option = \"stack-version\", description = \"The Elasticsearch version to record in TransportVersions.csv\")\n    public abstract Property<String> getStackVersion();\n\n    @TaskAction\n    public void run() throws IOException {\n        Version stackVersion = Version.fromString(getStackVersion().get());\n        String upperBoundName = getUpperBoundName(stackVersion);\n        TransportVersionResourcesService resources = getResourceService().get();\n        TransportVersionUpperBound upperBound = resources.getUpperBoundFromGitBase(upperBoundName);\n\n        if (upperBound == null) {\n            throw new RuntimeException(\"Missing upper bound \" + upperBoundName + \" for stack version \" + stackVersion);\n        }\n\n        int expectedTransportVersionId = upperBound.definitionId().complete();\n\n        // Check if this version is already in the CSV file (idempotency check)\n        Integer existingTransportVersionId = getExistingTransportVersionId(stackVersion);\n        if (existingTransportVersionId != null) {\n            if (existingTransportVersionId != expectedTransportVersionId) {\n                throw new RuntimeException(\n                    \"Version \"\n                        + stackVersion\n                        + \" already exists in TransportVersions.csv with transport version ID \"\n                        + existingTransportVersionId\n                        + \", but expected \"\n                        + expectedTransportVersionId\n                );\n            }\n            getLogger().lifecycle(","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/UpdateTransportVersionsCSVTask.java#L28-L64","documentation":"RuntimeException from UpdateTransportVersionsCSVTask.run() when getUpperBoundFromGitBase(upperBoundName) returns null for the given stack version. Before appending a row to TransportVersions.csv the task needs the upper bound (max transport-version id) for the release branch derived from the stack version.","triggerScenarios":"The upper-bound CSV named by getUpperBoundName(stackVersion) does not exist in the git base of the transport-resources directory when updating the canonical TransportVersions.csv.","commonSituations":"Running the update task for a stack version whose branch upper bound was never created; pointing at the wrong base; the resources directory not synced with upstream; running before GenerateInitialTransportVersionTask has seeded the upper bound.","solutions":["Run GenerateInitialTransportVersionTask for the stack version first to create the upper bound.","Confirm the upper-bound file for the derived branch name exists on the base branch.","Sync the transport-resources directory from the base/upstream before re-running the update task."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"String upperBoundName = getUpperBoundName(stackVersion);\nTransportVersionUpperBound upperBound = resources.getUpperBoundFromGitBase(upperBoundName);\nif (upperBound == null) {\n    throw new IllegalStateException(\"No upper bound '\" + upperBoundName + \"' for \" + stackVersion + \"; run GenerateInitialTransportVersionTask first\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run the initial-version task before the update task for a new release.","Sync the resources directory from the base branch first.","Confirm the branch upper-bound file exists upstream before updating the CSV."],"tags":["transport-version","release-workflow","build-tooling","git"],"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T06:17:24.410Z"}