pinpoint-apm/pinpoint · error · IllegalArgumentException

unsupported DataType:${dataType}

Error message

unsupported DataType:${dataType}

What it means

AnnotationTranscoder.decode() switches over the known DataType type codes when deserializing an annotation value from bytes; if the code read from the buffer is not one of the decodable codes, it throws IllegalArgumentException. This typically means the byte payload was written with a type code this transcoder version does not know.

Source

Thrown at commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/AnnotationTranscoder.java:100

            case CODE_BOOLEAN_FALSE -> Boolean.FALSE;
            case CODE_INT -> BytesUtils.bytesToSVar32(data, 0);
            case CODE_LONG -> BytesUtils.bytesToSVar64(data, 0);
            case CODE_BYTE -> data[0];
            case CODE_SHORT ->
                // need short casting
                    (short) BytesUtils.bytesToSVar32(data, 0);
            case CODE_FLOAT -> Float.intBitsToFloat(ByteArrayUtils.bytesToInt(data, 0));
            case CODE_DOUBLE -> Double.longBitsToDouble(ByteArrayUtils.bytesToLong(data, 0));
            case CODE_BYTEARRAY -> data;
            case CODE_NULL -> null;
            case CODE_TOSTRING -> decodeString(data);
            case CODE_INT_STRING -> decodeIntStringValue(data);
            case CODE_INT_STRING_STRING -> decodeIntStringStringValue(data);
            case CODE_STRING_STRING -> decodeStringStringValue(data);
            case CODE_LONG_INT_INT_BYTE_BYTE_STRING -> decodeLongIntIntByteByteStringValue(data);
            case CODE_INT_BOOLEAN_INT_BOOLEAN -> decodeIntBooleanIntBooleanValue(data);
            case CODE_BYTES_STRING_STRING -> decodeBytesStringStringValue(data);
            default -> throw new IllegalArgumentException("unsupported DataType:" + dataType);
        };
    }

    /**
     * @deprecated Since 4.0.0. Use {@link #getEncoder(Object)}, which resolves
     * the type code and the encoding logic with a single type dispatch.
     */
    @Deprecated
    public byte getTypeCode(Object o) {
        if (o == null) {
            return CODE_NULL;
        }
        if (o instanceof Number) {
            if (o instanceof Long) {
                return CODE_LONG;
            } else if (o instanceof Integer) {
                return CODE_INT;
            } else if (o instanceof Short) {

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Upgrade pinpoint commons-server so the transcoder recognizes the type code that was serialized
  2. Log/inspect dataType.getCode() on failure and add a decode case if it is a new supported type
  3. Verify the byte array passed in is the full, uncorrupted serialized value (not truncated, wrong offset)
  4. Prefer getEncoder(Object)/current APIs over the deprecated transcode path, which has fewer supported codes

Example fix

// before
Object value = transcoder.decode(dataType, bytes); // throws for unknown code
// after
if (transcoder.isSupported(dataType)) {
    Object value = transcoder.decode(dataType, bytes);
} else {
    log.warn("unsupported annotation type {}", dataType);
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (!isKnownDataType(dataType)) { log.warn("unsupported DataType {}", dataType); return null; }

Try / catch

try { return transcoder.decode(dataType, bytes); } catch (IllegalArgumentException e) { log.warn("decode failed: {}", e.getMessage()); return null; }

Prevention

When it happens

Trigger: Calling decode(dataType, byte[] data) with a DataType that has no decode case — e.g. a type code outside CODE_INT_STRING..CODE_BYTES_STRING_STRING, or a newer code written by a newer collector being read by an older server.

Common situations: Version skew between agent/collector that serialized annotations and the server decoding them; corrupt serialized annotation blobs; passing an arbitrary DataType into a deprecated decode API.

Related errors


AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07). Data as JSON: /api/errors/7afd2f5e69866efe. Report an issue: GitHub.