{"record":{"id":"839ea8e783ed7010","repo":"apache/seatunnel","slug":"parse-ip-address-failed","errorCode":"PARSE_IP_ADDRESS_FAILED","errorMessage":"PARSE_IP_ADDRESS_FAILED","messagePattern":"PARSE_IP_ADDRESS_FAILED","errorType":"error_code","errorClass":"CassandraConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cassandra/src/main/java/org/apache/seatunnel/connectors/seatunnel/cassandra/util/TypeConvertUtil.java","lineNumber":313,"sourceCode":"        switch (type.getProtocolCode()) {\n            case ProtocolConstants.DataType.VARCHAR:\n            case ProtocolConstants.DataType.ASCII:\n                statement = statement.setString(index, (String) fileValue);\n                return statement;\n            case ProtocolConstants.DataType.VARINT:\n                statement = statement.setBigInteger(index, new BigInteger((String) fileValue));\n                return statement;\n            case ProtocolConstants.DataType.UUID:\n            case ProtocolConstants.DataType.TIMEUUID:\n                statement = statement.setUuid(index, UUID.fromString((String) fileValue));\n                return statement;\n            case ProtocolConstants.DataType.INET:\n                try {\n                    statement =\n                            statement.setInetAddress(\n                                    index, InetAddress.getByName((String) fileValue));\n                } catch (UnknownHostException e) {\n                    throw new CassandraConnectorException(\n                            CassandraConnectorErrorCode.PARSE_IP_ADDRESS_FAILED, e);\n                }\n                return statement;\n            case ProtocolConstants.DataType.TINYINT:\n                statement = statement.setByte(index, (Byte) fileValue);\n                return statement;\n            case ProtocolConstants.DataType.SMALLINT:\n                statement = statement.setShort(index, (Short) fileValue);\n                return statement;\n            case ProtocolConstants.DataType.INT:\n                statement = statement.setInt(index, (Integer) fileValue);\n                return statement;\n            case ProtocolConstants.DataType.BIGINT:\n            case ProtocolConstants.DataType.COUNTER:\n                statement = statement.setLong(index, (Long) fileValue);\n                return statement;\n            case ProtocolConstants.DataType.FLOAT:\n                statement = statement.setFloat(index, (Float) fileValue);","sourceCodeStart":295,"sourceCodeEnd":331,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cassandra/src/main/java/org/apache/seatunnel/connectors/seatunnel/cassandra/util/TypeConvertUtil.java#L295-L331","documentation":"reconvertAndInject writes SeaTunnel field values back into a Cassandra bound statement. For INET columns it parses the string with InetAddress.getByName; when the host/IP string is unresolvable or malformed it throws PARSE_IP_ADDRESS_FAILED wrapping the UnknownHostException.","triggerScenarios":"Writing a row whose INET column value is not a valid literal IP address and is not resolvable as a hostname (UnknownHostException from InetAddress.getByName).","commonSituations":"Passing empty strings, invalid formats ('999.1.1.1'), or hostnames when DNS is unavailable in the job environment; seed data with malformed IP strings.","solutions":["Supply a valid literal IPv4/IPv6 address string (e.g. \"192.168.0.1\") for INET columns","Verify the value has no surrounding whitespace or placeholders","Fix DNS resolution if a hostname is intentionally used, or use the IP instead","Validate/normalize the column upstream before writing"],"exampleFix":"// before\n{\"ip\": \"192.168.0.999\"}\n// after\n{\"ip\": \"192.168.0.1\"}","handlingStrategy":"validation","validationCode":"String v = (String) fileValue;\nboolean valid = v != null && !v.trim().isEmpty()\n    && (v.matches(\"^(\\\\d{1,3}\\\\.){3}\\\\d{1,3}$\") || v.matches(\"^[0-9a-fA-F:]+$\"));\nif (!valid) throw new IllegalArgumentException(\"invalid INET value: \" + v);","typeGuard":"boolean isParseableInet(String s) {\n    try { InetAddress.getByName(s); return true; } catch (UnknownHostException e) { return false; }\n}","tryCatchPattern":"try {\n    stmt = stmt.setInetAddress(i, InetAddress.getByName(ip));\n} catch (UnknownHostException e) {\n    throw new IllegalArgumentException(\"Cannot parse INET value: \" + ip, e);\n}","preventionTips":["Store literal IP strings (no hostnames) in INET columns destined for SeaTunnel","Trim/normalize IP values upstream","Ensure the job environment can resolve DNS if hostnames are allowed"],"tags":["cassandra","inet","address-parsing"],"backgroundTag":"invalid-ip-address","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}