{"record":{"id":"4a3a23e34efb9539","repo":"elastic/elasticsearch","slug":"invalid-qualifier-qualifier","errorCode":null,"errorMessage":"Invalid qualifier: ${qualifier}","messagePattern":"Invalid qualifier: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/VersionPropertiesLoader.java","lineNumber":47,"sourceCode":"        return props;\n    }\n\n    protected static void loadBuildSrcVersion(Properties loadedProps, ProviderFactory providers) {\n        String elasticsearch = loadedProps.getProperty(\"elasticsearch\");\n        if (elasticsearch == null) {\n            throw new IllegalStateException(\"Elasticsearch version is missing from properties.\");\n        }\n        if (elasticsearch.matches(\"[0-9]+\\\\.[0-9]+\\\\.[0-9]+\") == false) {\n            throw new IllegalStateException(\n                    \"Expected elasticsearch version to be numbers only of the form  X.Y.Z but it was: \" +\n                            elasticsearch\n            );\n        }\n        String qualifier = providers.systemProperty(\"build.version_qualifier\")\n                .getOrElse(\"\");\n        if (qualifier.isEmpty() == false) {\n            if (qualifier.matches(\"(alpha|beta|rc)\\\\d+\") == false) {\n                throw new IllegalStateException(\"Invalid qualifier: \" + qualifier);\n            }\n            elasticsearch += \"-\" + qualifier;\n        }\n        final String buildSnapshotSystemProperty = providers.systemProperty(\"build.snapshot\")\n                .getOrElse(\"true\");\n        switch (buildSnapshotSystemProperty) {\n            case \"true\":\n                elasticsearch += \"-SNAPSHOT\";\n                break;\n            case \"false\":\n                // do nothing\n                break;\n            default:\n                throw new IllegalArgumentException(\n                        \"build.snapshot was set to [\" + buildSnapshotSystemProperty + \"] but can only be unset or [true|false]\");\n        }\n        loadedProps.put(\"elasticsearch\", elasticsearch);\n    }","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/VersionPropertiesLoader.java#L29-L65","documentation":"When the build.version_qualifier system property is non-empty, the loader requires it to match (alpha|beta|rc)\\d+ (e.g. alpha1, beta2, rc3). Any other value — wrong casing, missing digit, or an unrelated string — is rejected so the constructed version stays parseable.","triggerScenarios":"Running Gradle with -Dbuild.version_qualifier set to something like alpha, rc, snapshot, m1, or Alpha1 (case-sensitive, capital A fails the regex).","commonSituations":"A CI pipeline passes a milestone-style qualifier the regex does not allow; a developer experiments with -Dbuild.version_qualifier=dev; a release script uppercases the qualifier; trailing whitespace in the value breaks the match.","solutions":["Set the qualifier to a value matching alpha|beta followed by digits, e.g. -Dbuild.version_qualifier=beta1.","Omit the property entirely if you want a plain release/SNAPSHOT version.","Strip whitespace and lowercase the value before passing it."],"exampleFix":"// before\n./gradlew build -Dbuild.version_qualifier=Beta1\n// after\n./gradlew build -Dbuild.version_qualifier=beta1","handlingStrategy":"validation","validationCode":"String q = System.getProperty(\"build.version_qualifier\", \"\");\nif (!q.isEmpty() && !q.matches(\"(alpha|beta|rc)\\\\d+\")) {\n    throw new GradleException(\"Invalid build.version_qualifier: \" + q);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Document the allowed qualifier shape (alpha|beta|rc + digits) in your release runbook.","Lowercase and trim any externally-supplied qualifier before mapping it to the sysprop.","Omit the property for plain snapshots."],"tags":["gradle","build-config","version-properties","validation","system-property"],"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T08:17:17.861Z"}