aeron-io/aeron · error · InvalidMessage

Invalid value type

Error message

Invalid value type

What it means

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.

Solutions

  1. Verify the buffer passed to the decoder starts exactly at the CBOR message start (no stale offset).
  2. Regenerate the event log with the same Aeron version used for decoding.
  3. Check for buffer corruption/truncation upstream before parsing.
  4. Extend the switch in parseEntry to handle the missing major type if you control the encoder.

Example fix

// before
case SIMPLE_VALUE_MAJOR_TYPE:
    parseSimpleValue(state, valueAdditionalContent);
    break;
default:
    throw new InvalidMessage("Invalid value type");
// after
case TAG_MAJOR_TYPE: // support previously-unsupported major type
case SIMPLE_VALUE_MAJOR_TYPE:
    parseSimpleValue(state, valueAdditionalContent);
    break;
default:
    throw new InvalidMessage("Invalid value type " + state.buffer().getByte(state.offset()));
Defensive patterns

Strategy: try-catch

Validate before calling

// check first byte's major type is in the supported set before decoding
int majorType = (buffer.getByte(offset) & 0xE0) >> 5;
if (majorType > 7 || majorType == 6) { /* skip or reject record */ }

Type guard

boolean isSupportedCborMajorType(final byte firstByte)
{
    final int majorType = (firstByte & 0xE0) >> 5;
    return majorType != 6 && majorType != 7; // adjust per supported set
}

Try / catch

try
{
    cborDecoder.decode(buffer, offset, limit);
}
catch (final InvalidMessage ex)
{
    LOGGER.warn("skipping malformed CBOR record at " + offset + ": " + ex.getMessage());
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


AI-assisted analysis of aeron-io/aeron@6d60124e15 (2026-09-12). Data as JSON: /api/errors/72fbad22c93cea94. Report an issue: GitHub.

Appendix: source

Thrown at aeron-client/src/main/java/io/aeron/logging/CborDecode.java:257

                }

                break;
            }
            case BYTE_ARRAY_MAJOR_TYPE:
                parseByteArray(state, byteArrayView, valueAdditionalContent);
                for (int i = 0, n = loggers.size(); i < n; i++)
                {
                    final LoggerEventCallback logger = loggers.get(i);
                    logger.onValue(keyAsciiView, tag, byteArrayView);
                }
                break;

            case SIMPLE_VALUE_MAJOR_TYPE:
                parseSimpleValue(state, valueAdditionalContent);
                break;

            default:
                throw new InvalidMessage("Invalid value type");
        }
    }

    private static int additionalContent(final int keyTypeByte)
    {
        return (0b000_11111) & keyTypeByte;
    }

    private static int majorType(final int fullTypeByte)
    {
        return (0xFF) & (0b111_00000 & fullTypeByte);
    }

    private static long parseNumber(
        final DecodingState state,
        final int valueMajorType,
        final int valueAdditionalContent)
    {

View on GitHub (pinned to 6d60124e15)