{"record":{"id":"0fd4d358645c31be","repo":"elastic/elasticsearch","slug":"invalid-tag-format-l","errorCode":null,"errorMessage":"Invalid tag format [{l}]","messagePattern":"Invalid tag format \\[(.+?)\\]","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/release/AbstractVersionsTask.java","lineNumber":136,"sourceCode":"\n    static final String SERVER_MODULE_PATH = \"server/src/main/java/\";\n\n    static final String VERSION_FILE_PATH = SERVER_MODULE_PATH + \"org/elasticsearch/Version.java\";\n    static final String INDEX_VERSIONS_FILE_PATH = SERVER_MODULE_PATH + \"org/elasticsearch/index/IndexVersions.java\";\n\n    static final String SERVER_RESOURCES_PATH = \"server/src/main/resources/\";\n    static final String INDEX_VERSIONS_RECORD = SERVER_RESOURCES_PATH + \"org/elasticsearch/index/IndexVersions.csv\";\n\n    final Path rootDir;\n\n    protected AbstractVersionsTask(BuildLayout layout) {\n        rootDir = layout.getRootDirectory().toPath();\n    }\n\n    static Map<String, Integer> splitVersionIds(List<String> version) {\n        return version.stream().map(l -> {\n            var split = l.split(\":\");\n            if (split.length != 2) throw new IllegalArgumentException(\"Invalid tag format [\" + l + \"]\");\n            return split;\n        }).collect(Collectors.toMap(l -> l[0], l -> Integer.parseInt(l[1])));\n    }\n\n    static OptionalInt findSingleIntegerExpr(FieldDeclaration field) {\n        var ints = field.findAll(IntegerLiteralExpr.class);\n        switch (ints.size()) {\n            case 0 -> {\n                return OptionalInt.empty();\n            }\n            case 1 -> {\n                return OptionalInt.of(ints.get(0).asNumber().intValue());\n            }\n            default -> {\n                LOGGER.warn(\"Multiple integers found in version field declaration [{}]\", field); // and ignore it\n                return OptionalInt.empty();\n            }\n        }","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/release/AbstractVersionsTask.java#L118-L154","documentation":"Thrown by AbstractVersionsTask.splitVersionIds when a line in the version-list input does not split on ':' into exactly two parts. Each line is expected to be '<id>:<value>'; any line with zero, one, or three+ colon-separated fields is malformed and the task cannot build its version-id map.","triggerScenarios":"splitVersionIds maps over a List<String> of version entries, splitting each on ':'; if split.length != 2 the entry is rejected. This input is read from tag/version metadata produced elsewhere (e.g. the --output-file of ExtractCurrentVersionsTask), so a malformed line indicates a corrupted or hand-edited input file or a change in the producer's format.","commonSituations":"Hand-editing the version-list file; a producer task changed its output format but the consumer wasn't updated; trailing blank lines or stray characters; copy-paste introduced a line without the ':' separator; an empty line fed into the list.","solutions":["Inspect the offending line named by [l] in the message and correct it to the '<id>:<value>' form.","Regenerate the input file via the producing task (e.g. re-run ExtractCurrentVersionsTask) rather than editing by hand.","Filter out blank/whitespace lines before calling splitVersionIds if the producer may emit them.","Re-run the consuming release task."],"exampleFix":"// before (malformed line)\nIndexVersion:42\nBadLineWithoutColon\n// after\nIndexVersion:42\nOtherId:43","handlingStrategy":"validation","validationCode":"for (String l : versionLines) {\n    String[] split = l.split(\":\");\n    if (split.length != 2) throw new IllegalArgumentException(\"Bad version line: \" + l);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Generate version-list files with the producer task rather than editing by hand.","Strip blank lines before parsing.","Add a schema check in the producer so malformed lines never get written."],"tags":["build","gradle","release","versioning","config"],"backgroundTag":null,"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}