{"record":{"id":"7679f8e1fec73a45","repo":"elastic/elasticsearch","slug":"could-not-convert-string-to-transport-protoco","errorCode":null,"errorMessage":"could not convert string [{}] to transport protocol","messagePattern":"could not convert string \\[(.+?)\\] to transport protocol","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/CommunityIdProcessor.java","lineNumber":509,"sourceCode":"\n        private static Transport fromObject(Object o) {\n            if (o instanceof Number number) {\n                return fromNumber(number.intValue());\n            } else if (o instanceof String protocolStr) {\n                // check if matches protocol name\n                if (Type.TRANSPORT_NAMES.containsKey(protocolStr.toLowerCase(Locale.ROOT))) {\n                    return new Transport(Type.TRANSPORT_NAMES.get(protocolStr.toLowerCase(Locale.ROOT)));\n                }\n\n                // check if convertible to protocol number\n                try {\n                    int protocolNumber = Integer.parseInt(protocolStr);\n                    return fromNumber(protocolNumber);\n                } catch (NumberFormatException e) {\n                    // fall through to IllegalArgumentException\n                }\n\n                throw new IllegalArgumentException(\"could not convert string [\" + protocolStr + \"] to transport protocol\");\n            } else {\n                throw new IllegalArgumentException(\n                    \"could not convert value of type [\" + o.getClass().getName() + \"] to transport protocol\"\n                );\n            }\n        }\n    }\n\n    public enum IcmpType {\n        EchoReply(0),\n        EchoRequest(8),\n        RouterAdvertisement(9),\n        RouterSolicitation(10),\n        TimestampRequest(13),\n        TimestampReply(14),\n        InfoRequest(15),\n        InfoReply(16),\n        AddressMaskRequest(17),","sourceCodeStart":491,"sourceCodeEnd":527,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/CommunityIdProcessor.java#L491-L527","documentation":"Transport.fromObject, given a String that is neither a known transport name (matched case-insensitively against TRANSPORT_NAMES) nor parseable by Integer.parseInt, throws this. The literal offending string is interpolated. Compare with 1114 (numeric out of range) and 1116 (non-String/Number type).","triggerScenarios":"network.transport = 'tcp6', 'TLS', 'icmp4', 'unknown', or any string that is neither a recognized protocol name nor an integer. Numeric strings that parse but fall outside the IANA range throw 1114 instead.","commonSituations":"Producer uses non-standard protocol names; mixed-case variants ('Tcp', 'TCP ') not in the name table; trailing whitespace; values like 'TCP/UDP' that include both.","solutions":["Map the producer's protocol identifier to a supported name (tcp, udp, sctp, icmp, icmpv6, igmp, gre, eigrp, ospf, pim) or to a numeric IANA value before community_id runs.","Strip whitespace and lowercase the value upstream.","Fall back to providing network.iana_number instead of network.transport if your transport names are non-standard.","Quarantine via on_failure."],"exampleFix":"// before — non-standard transport name\n//   { \"network\": { \"transport\": \"tcp6\" } }\n//\n// after — recognized name or numeric IANA protocol number\n//   { \"network\": { \"transport\": \"tcp\" } }","handlingStrategy":"validation","validationCode":"private static final java.util.Set<String> NAMES = java.util.Set.of(\n    \"tcp\",\"udp\",\"sctp\",\"icmp\",\"icmpv6\",\"igmp\",\"gre\",\"eigrp\",\"ospf\",\"pim\");\nboolean isRecognizedTransportString(String s) {\n    if (s == null) return false;\n    String lc = s.toLowerCase(java.util.Locale.ROOT).trim();\n    return NAMES.contains(lc) || lc.matches(\"[+-]?\\\\d+\");\n}","typeGuard":"static boolean isTransportable(Object o) {\n    if (o instanceof Number) return true;\n    if (o instanceof String s) return s.matches(\"[+-]?\\\\d+\")\n        || java.util.Set.of(\"tcp\",\"udp\",\"sctp\",\"icmp\",\"icmpv6\",\"igmp\",\"gre\",\"eigrp\",\"ospf\",\"pim\")\n            .contains(s.toLowerCase(java.util.Locale.ROOT).trim());\n    return false;\n}","tryCatchPattern":"{\n  \"community_id\": {\n    \"on_failure\": [\n      { \"set\": { \"field\": \"ingest.error\", \"value\": \"community-id-bad-transport-name\" } },\n      { \"redirect\": { \"pipeline\": \"quarantine\" } }\n    ]\n  }\n}","preventionTips":["Use the IANA protocol names exactly: tcp, udp, sctp, icmp, icmpv6, igmp, gre, eigrp, ospf, pim.","Lowercase and trim transport values upstream.","If your producer uses non-standard names, map them to a name or numeric value before community_id."],"tags":["ingest","community-id","transport","validation"],"backgroundTag":null,"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T12:31:55.035Z"}