{"record":{"id":"72fbad22c93cea94","repo":"aeron-io/aeron","slug":"invalid-value-type","errorCode":null,"errorMessage":"Invalid value type","messagePattern":"Invalid value type","errorType":"validation","errorClass":"InvalidMessage","httpStatus":null,"severity":"error","filePath":"aeron-client/src/main/java/io/aeron/logging/CborDecode.java","lineNumber":257,"sourceCode":"                }\n\n                break;\n            }\n            case BYTE_ARRAY_MAJOR_TYPE:\n                parseByteArray(state, byteArrayView, valueAdditionalContent);\n                for (int i = 0, n = loggers.size(); i < n; i++)\n                {\n                    final LoggerEventCallback logger = loggers.get(i);\n                    logger.onValue(keyAsciiView, tag, byteArrayView);\n                }\n                break;\n\n            case SIMPLE_VALUE_MAJOR_TYPE:\n                parseSimpleValue(state, valueAdditionalContent);\n                break;\n\n            default:\n                throw new InvalidMessage(\"Invalid value type\");\n        }\n    }\n\n    private static int additionalContent(final int keyTypeByte)\n    {\n        return (0b000_11111) & keyTypeByte;\n    }\n\n    private static int majorType(final int fullTypeByte)\n    {\n        return (0xFF) & (0b111_00000 & fullTypeByte);\n    }\n\n    private static long parseNumber(\n        final DecodingState state,\n        final int valueMajorType,\n        final int valueAdditionalContent)\n    {","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-client/src/main/java/io/aeron/logging/CborDecode.java#L239-L275","documentation":"CborDecode.parseEntry encountered a CBOR major type it does not know how to decode while parsing a log event entry. The library supports a fixed subset of CBOR major types (unsigned/negative integers, byte strings, text strings, arrays, maps, simple values); any other major type (e.g. tags, floats mapped elsewhere, or corrupt type bits) reaches the default branch and throws. This indicates malformed or unsupported CBOR data in the event log.","triggerScenarios":"Decoding an event log buffer whose CBOR payload contains a major type outside the supported set — typically a corrupt or truncated buffer, or data written by a different encoder version that emits CBOR tags (major type 6) or unsupported simple/float encodings.","commonSituations":"Reading event logs captured by a newer/older Aeron version with an extended CBOR dialect; pointing a decoder at a corrupted log buffer; mixing capture and decode tool versions; byte-offset misalignment when slicing a buffer.","solutions":["Verify the buffer passed to the decoder starts exactly at the CBOR message start (no stale offset).","Regenerate the event log with the same Aeron version used for decoding.","Check for buffer corruption/truncation upstream before parsing.","Extend the switch in parseEntry to handle the missing major type if you control the encoder."],"exampleFix":"// before\ncase SIMPLE_VALUE_MAJOR_TYPE:\n    parseSimpleValue(state, valueAdditionalContent);\n    break;\ndefault:\n    throw new InvalidMessage(\"Invalid value type\");\n// after\ncase TAG_MAJOR_TYPE: // support previously-unsupported major type\ncase SIMPLE_VALUE_MAJOR_TYPE:\n    parseSimpleValue(state, valueAdditionalContent);\n    break;\ndefault:\n    throw new InvalidMessage(\"Invalid value type \" + state.buffer().getByte(state.offset()));","handlingStrategy":"try-catch","validationCode":"// check first byte's major type is in the supported set before decoding\nint majorType = (buffer.getByte(offset) & 0xE0) >> 5;\nif (majorType > 7 || majorType == 6) { /* skip or reject record */ }","typeGuard":"boolean isSupportedCborMajorType(final byte firstByte)\n{\n    final int majorType = (firstByte & 0xE0) >> 5;\n    return majorType != 6 && majorType != 7; // adjust per supported set\n}","tryCatchPattern":"try\n{\n    cborDecoder.decode(buffer, offset, limit);\n}\ncatch (final InvalidMessage ex)\n{\n    LOGGER.warn(\"skipping malformed CBOR record at \" + offset + \": \" + ex.getMessage());\n}","preventionTips":["Keep encoder and decoder Aeron versions identical.","Always start decoding at a record boundary from the log header.","Validate capture buffers for truncation before decode.","Wrap per-record decoding in try-catch so one bad record doesn't abort the log scan."],"tags":["cbor","decoding","serialization"],"backgroundTag":"invalid-argument-format","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"}