{"record":{"id":"9564c86df7e248db","repo":"elastic/elasticsearch","slug":"missing-upper-bound-for-release-version","errorCode":null,"errorMessage":"Missing upper bound {} for release version {}","messagePattern":"Missing upper bound (.+?) for release version (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/GenerateInitialTransportVersionTask.java","lineNumber":48,"sourceCode":"    public abstract Property<String> getStackVersion();\n\n    @Input\n    abstract Property<Version> getCurrentVersion();\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 baseUpperBound = resources.getUpperBoundFromGitBase(upperBoundName);\n        String initialDefinitionName = \"initial_\" + stackVersion;\n        TransportVersionDefinition existingDefinition = resources.getUnreferableDefinitionFromGitBase(initialDefinitionName);\n\n        // This task runs on main and release branches. In release branches we will generate the exact same\n        // upper bound result because we always look at the base branch (ie upstream/main).\n        if (existingDefinition == null) {\n            if (baseUpperBound == null) {\n                throw new RuntimeException(\"Missing upper bound \" + upperBoundName + \" for release version \" + stackVersion);\n            }\n\n            // minors increment by 1000 to create a unique base, patches increment by 1 as other patches do\n            int increment = stackVersion.getRevision() == 0 ? 1000 : 1;\n            var id = TransportVersionId.fromInt(baseUpperBound.definitionId().complete() + increment);\n            var definition = new TransportVersionDefinition(initialDefinitionName, List.of(id), false);\n            resources.writeDefinition(definition);\n            var newUpperBound = new TransportVersionUpperBound(upperBoundName, initialDefinitionName, id);\n            resources.writeUpperBound(newUpperBound);\n\n            Version currentVersion = getCurrentVersion().get();\n            String currentUpperBoundName = getUpperBoundName(currentVersion);\n            if (stackVersion.getRevision() == 0) {\n                // a minor creates a new base, which the current branch must also point at\n                resources.writeUpperBound(new TransportVersionUpperBound(currentUpperBoundName, initialDefinitionName, id));\n            } else if (currentUpperBoundName.equals(upperBoundName) == false) {\n                // A patch adds an id to an existing base. If the current branch's upper bound still points into that\n                // same base, that patch id is now the latest id for the base, which the current branch cannot adopt:","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/GenerateInitialTransportVersionTask.java#L30-L66","documentation":"RuntimeException from GenerateInitialTransportVersionTask.run() when both the initial_<version> definition and the base upper bound for the current stack version are absent from git base. The task bootstraps transport versions for a new release branch and expects an existing upper bound to anchor the new ids.","triggerScenarios":"Running the initial-version task for a stack version whose upper-bound CSV (named after getUpperBoundName(stackVersion)) does not exist in the upstream/base git revision of the transport-resources directory.","commonSituations":"Creating a new minor/major release without first establishing its upper-bound file on main; pointing the task at the wrong base branch; the resources submodule/directory is out of sync with upstream.","solutions":["Confirm the upper-bound file for the target branch name exists on the base branch (upstream/main).","Run on a branch that is up to date with the base so getUpperBoundFromGitBase can find the file.","If bootstrapping a brand-new release line, create the seed upper-bound file first per the documented workflow."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"String upperBoundName = getUpperBoundName(stackVersion);\nTransportVersionUpperBound baseUpperBound = resources.getUpperBoundFromGitBase(upperBoundName);\nif (baseUpperBound == null) {\n    throw new IllegalStateException(\"No upper bound '\" + upperBoundName + \"' on base branch. Run on main / sync resources first.\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure the seed upper-bound file exists on main before branching.","Run the initial-version task from a branch up to date with upstream.","Keep the transport-resources directory synced before release tasks."],"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"}