{"record":{"id":"d1d805a6608ea787","repo":"elastic/elasticsearch","slug":"invalid-transport-version-data-file","errorCode":null,"errorMessage":"Invalid transport version data file [{}]: {}","messagePattern":"Invalid transport version data file \\[(.+?)\\]: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/TransportVersionReference.java","lineNumber":37,"sourceCode":"import java.nio.file.Path;\nimport java.util.ArrayList;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Set;\n\nimport static org.gradle.api.artifacts.type.ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE;\n\nrecord TransportVersionReference(String name, String location) {\n\n    private static final Attribute<Boolean> REFERENCES_ATTRIBUTE = Attribute.of(\"transport-version-references\", Boolean.class);\n\n    static List<TransportVersionReference> listFromFile(Path file) throws IOException {\n        assert file.toString().endsWith(\".csv\") : file + \" does not end in .csv\";\n        List<TransportVersionReference> results = new ArrayList<>();\n        for (String line : Files.readAllLines(file, StandardCharsets.UTF_8)) {\n            String[] parts = line.split(\",\", 2);\n            if (parts.length != 2) {\n                throw new IOException(\"Invalid transport version data file [\" + file + \"]: \" + line);\n            }\n            results.add(new TransportVersionReference(parts[0], parts[1]));\n        }\n        return results;\n    }\n\n    static void addArtifactAttribute(AttributeContainer attributes) {\n        attributes.attribute(ARTIFACT_TYPE_ATTRIBUTE, \"csv\");\n        attributes.attribute(REFERENCES_ATTRIBUTE, true);\n    }\n\n    static Set<String> collectNames(Iterable<File> referencesFiles) throws IOException {\n        Set<String> names = new HashSet<>();\n        for (var referencesFile : referencesFiles) {\n            listFromFile(referencesFile.toPath()).stream().map(TransportVersionReference::name).forEach(names::add);\n        }\n        return names;\n    }","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/TransportVersionReference.java#L19-L55","documentation":"IOException from TransportVersionReference.listFromFile() when a line in a transport-version references CSV file does not split into exactly 2 comma-separated fields (name, location). The CSV must have a consistent two-column shape.","triggerScenarios":"A references CSV line has fewer or more than one comma - e.g. an unquoted location containing a comma, a blank line, or a malformed line produced by the collection task.","commonSituations":"The location field (which embeds 'classname line N') was changed to include an extra comma; a blank/whitespace-only line slipped into the file; the file was concatenated incorrectly.","solutions":["Open the file at the reported path and find the offending line shown in the message.","Ensure each line has exactly one comma separating name from location; quote/escape if location may contain commas.","Regenerate the references file via CollectTransportVersionReferencesTask to restore the canonical format."],"exampleFix":"// before: my_feature,org.elasticsearch.Foo line 1,2\n// after:  my_feature,org.elasticsearch.Foo line 12","handlingStrategy":"validation","validationCode":"for (String line : Files.readAllLines(file, StandardCharsets.UTF_8)) {\n    String[] parts = line.split(\",\", 2);\n    if (parts.length != 2 || parts[0].isBlank() || parts[1].isBlank()) {\n        throw new IOException(\"Invalid references line in \" + file + \": \" + line);\n    }\n}","typeGuard":"static boolean isValidReferenceLine(String line) {\n    String[] p = line.split(\",\", 2);\n    return p.length == 2 && !p[0].isBlank() && !p[1].isBlank();\n}","tryCatchPattern":null,"preventionTips":["Regenerate references CSVs from the collection task rather than editing by hand.","Quote the location field if it can contain commas, or strip commas from it.","Add a CI lint that rejects reference lines without exactly two columns."],"tags":["transport-version","csv-parsing","data-integrity","build-tooling"],"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T06:17:24.410Z"}