{"record":{"id":"30152a464043aa0e","repo":"aeron-io/aeron","slug":"unknown-res-type","errorCode":null,"errorMessage":"unknown RES_TYPE=","messagePattern":"unknown RES_TYPE=","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"aeron-client/src/main/java/io/aeron/protocol/ResolutionEntryFlyweight.java","lineNumber":260,"sourceCode":"        {\n            case RES_TYPE_NAME_TO_IP4_MD:\n                if (ADDRESS_LENGTH_IP4 != address.length)\n                {\n                    throw new IllegalArgumentException(\"Invalid address length: \" + address.length);\n                }\n                putBytes(ADDRESS_FIELD_OFFSET, address, 0, ADDRESS_LENGTH_IP4);\n                break;\n\n            case RES_TYPE_NAME_TO_IP6_MD:\n                if (ADDRESS_LENGTH_IP6 != address.length)\n                {\n                    throw new IllegalArgumentException(\"Invalid address length: \" + address.length);\n                }\n                putBytes(ADDRESS_FIELD_OFFSET, address, 0, ADDRESS_LENGTH_IP6);\n                break;\n\n            default:\n                throw new IllegalStateException(\"unknown RES_TYPE=\" + resType());\n        }\n\n        return this;\n    }\n\n    /**\n     * Get the address for the entry by copying it into the destination buffer.\n     *\n     * @param dstBuffer into which the address will be copied.\n     * @return length of the address copied.\n     */\n    public int getAddress(final byte[] dstBuffer)\n    {\n        switch (resType())\n        {\n            case RES_TYPE_NAME_TO_IP4_MD:\n                if (ADDRESS_LENGTH_IP4 > dstBuffer.length)\n                {","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-client/src/main/java/io/aeron/protocol/ResolutionEntryFlyweight.java#L242-L278","documentation":"ResolutionEntryFlyweight.putAddress throws IllegalStateException when the entry's resType() is not one of the known RES_TYPE values (RES_TYPE_NAME_TO_IP4_MD or RES_TYPE_NAME_TO_IP6_MD). The flyweight reads the type field from a raw network buffer, so an unknown value means the buffer is corrupted or a newer/older protocol version encoded a type this library does not understand.","triggerScenarios":"Calling putAddress(...) on a ResolutionEntryFlyweight whose underlying buffer contains a resType value other than 0 (NAME_TO_IP4_MD) or 1 (NAME_TO_IP6_MD) in the type field.","commonSituations":"Decoding a resolution entry from an untrusted/corrupted UDP buffer; interoperating with an Aeron driver of a different version that defines new RES_TYPE constants; reusing a flyweight over uninitialized or zeroed memory with an out-of-range type byte.","solutions":["Check resType() before calling putAddress and skip or log entries with unknown types","Upgrade/align the Aeron client version to match the driver/media producing the entries","Verify the buffer offset and contents — a corrupted or misaligned buffer can yield a garbage type value"],"exampleFix":"// before\nentryFlyweight.putAddress(address);\n// after\nshort resType = entryFlyweight.resType();\nif (resType == ResolutionEntryFlyweight.RES_TYPE_NAME_TO_IP4_MD ||\n    resType == ResolutionEntryFlyweight.RES_TYPE_NAME_TO_IP6_MD)\n{\n    entryFlyweight.putAddress(address);\n}","handlingStrategy":"validation","validationCode":"short rt = entry.resType();\nboolean known = rt == ResolutionEntryFlyweight.RES_TYPE_NAME_TO_IP4_MD || rt == ResolutionEntryFlyweight.RES_TYPE_NAME_TO_IP6_MD;\nif (!known) { /* skip/log entry */ }","typeGuard":"boolean isKnownResType(short rt) {\n    return rt == ResolutionEntryFlyweight.RES_TYPE_NAME_TO_IP4_MD ||\n           rt == ResolutionEntryFlyweight.RES_TYPE_NAME_TO_IP6_MD;\n}","tryCatchPattern":"try { entry.putAddress(address); }\ncatch (IllegalStateException e) { log.warn(\"Skipping entry with unknown RES_TYPE\", e); }","preventionTips":["Always check resType() before flyweight writes","Keep Aeron client and driver versions aligned","Never write raw type values not defined as RES_TYPE_* constants"],"tags":["aeron","protocol","buffer","flyweight"],"backgroundTag":"invalid-enum-value","analyzedSha":"6d60124e15e35c11b49ba2e3c2c2858a09a18803","analyzedAt":"2026-09-12T11:17:07.683Z","contentChangedAt":"2026-09-12T11:17:07.683Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}