{"record":{"id":"d736dd9ccffc3056","repo":"eclipse-vertx/vert.x","slug":"could-not-convert-address-data-to-inetaddress","errorCode":null,"errorMessage":"Could not convert address ${data} to InetAddress.","messagePattern":"Could not convert address (.+?) to InetAddress\\.","errorType":"exception","errorClass":"io.netty.handler.codec.DecoderException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/dns/impl/RecordDecoder.java","lineNumber":153,"sourceCode":"        return null;\n      }\n    };\n\n    static Function<DnsRecord, String> address(DnsRecordType type, int octets) {\n        return record -> {\n          if (record.type() == type) {\n            ByteBuf data = ((DnsRawRecord)record).content();\n            int size = data.readableBytes();\n            if (size != octets) {\n              throw new DecoderException(\"Invalid content length, or reader index when decoding address [index: \"\n                + data.readerIndex() + \", expected length: \" + octets + \", actual: \" + size + \"].\");\n            }\n            byte[] address = new byte[octets];\n            data.getBytes(data.readerIndex(), address);\n            try {\n              return InetAddress.getByAddress(address).getHostAddress();\n            } catch (UnknownHostException e) {\n              throw new DecoderException(\"Could not convert address \"\n                + data.toString(data.readerIndex(), size, CharsetUtil.UTF_8) + \" to InetAddress.\");\n            }\n          } else {\n            return null;\n          }\n        };\n    }\n\n    /**\n     * Retrieves a domain name given a buffer containing a DNS packet. If the\n     * name contains a pointer, the position of the buffer will be set to\n     * directly after the pointer's index after the name has been read.\n     *\n     * @param buf the byte buffer containing the DNS packet\n     * @return the domain name for an entry\n     */\n    static String readName(ByteBuf buf) {\n        int position = -1;","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/dns/impl/RecordDecoder.java#L135-L171","documentation":"Decoding error for A/AAAA DNS records: after the byte length matched, converting the record's ByteBuf content to an InetAddress failed. The message includes the raw buffer data; this indicates the server returned syntactically sized but invalid address bytes.","triggerScenarios":"Thrown at vertx-core/src/main/java/io/vertx/core/dns/impl/RecordDecoder.java:153 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry resolution against a different DNS server","Capture the reported buffer content to diagnose the non-rfc compliant response"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fb308bd8c3f12c79f4ae89bef67fadf6c80d036e","analyzedAt":"2026-09-06T11:37:12.241Z","contentChangedAt":"2026-09-06T11:37:12.241Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}