{"record":{"id":"cbd6015204a3fa66","repo":"elastic/elasticsearch","slug":"invalid-increment-must-be-no-larger-than-1000","errorCode":null,"errorMessage":"Invalid increment {}, must be no larger than 1000","messagePattern":"Invalid increment (.+?), must be no larger than 1000","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/AbstractGenerateTransportVersionDefinitionTask.java","lineNumber":116,"sourceCode":"        );\n        // (Re)write the definition file.\n        resources.writeDefinition(new TransportVersionDefinition(targetDefinitionName, ids, true));\n    }\n\n    private List<TransportVersionId> updateUpperBounds(\n        TransportVersionResourcesService resources,\n        List<TransportVersionUpperBound> existingUpperBounds,\n        Set<String> targetUpperBoundNames,\n        Map<Integer, List<IdAndDefinition>> idsByBase,\n        String definitionName\n    ) throws IOException {\n        String currentUpperBoundName = getCurrentUpperBoundName().get();\n        int increment = getIncrement().get();\n        if (increment <= 0) {\n            throw new IllegalArgumentException(\"Invalid increment \" + increment + \", must be a positive integer\");\n        }\n        if (increment > 1000) {\n            throw new IllegalArgumentException(\"Invalid increment \" + increment + \", must be no larger than 1000\");\n        }\n        List<TransportVersionId> ids = new ArrayList<>();\n\n        TransportVersionDefinition existingDefinition = resources.getReferableDefinitionFromGitBase(definitionName);\n        for (TransportVersionUpperBound existingUpperBound : existingUpperBounds) {\n            String upperBoundName = existingUpperBound.name();\n\n            if (targetUpperBoundNames.contains(upperBoundName)) {\n                // Case: targeting this upper bound, find an existing id if it exists\n                TransportVersionId targetId = maybeGetExistingId(existingUpperBound, existingDefinition, definitionName);\n                if (targetId == null) {\n                    // Case: an id doesn't yet exist for this upper bound, so create one\n                    int targetIncrement = upperBoundName.equals(currentUpperBoundName) ? increment : 1;\n                    targetId = createTargetId(existingUpperBound, targetIncrement);\n                    var newUpperBound = new TransportVersionUpperBound(upperBoundName, definitionName, targetId);\n                    writeUpperBound(resources, newUpperBound);\n                }\n                ids.add(targetId);","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/AbstractGenerateTransportVersionDefinitionTask.java#L98-L134","documentation":"IllegalArgumentException when the increment value exceeds 1000. The task caps increments to keep transport-version ids from jumping more than one base boundary (minors use 1000, patches use 1), so values above 1000 are rejected.","triggerScenarios":"getIncrement().get() returns a value > 1000, typically from a typo or a script computing the increment incorrectly.","commonSituations":"Passing --increment=10000 by mistake; treating a minor bump (which should be 1000) as a larger custom value; off-by orders-of-magnitude typo.","solutions":["Use a value <= 1000; for minor bumps the canonical value is 1000 and for patches it is 1.","Re-check the wrapper script or CI job that computes the increment.","If a larger jump is genuinely needed, revisit the transport-version scheme rather than raising the cap."],"exampleFix":"// before: ./gradlew generateTransportVersionDefinition --increment=5000\n// after:  ./gradlew generateTransportVersionDefinition --increment=1000","handlingStrategy":"validation","validationCode":"int increment = getIncrement().get();\nif (increment > 1000) {\n    throw new IllegalArgumentException(\"--increment must be <= 1000 (use 1000 for minors, 1 for patches), got \" + increment);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use 1000 for minor bumps and 1 for patches - never arbitrary larger values.","Double-check wrapper scripts that compute increment for typos.","Document the 1/1000 convention next to the task's option declaration."],"tags":["transport-version","validation","build-tooling","configuration"],"backgroundTag":null,"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}