pinpoint-apm/pinpoint · error · IllegalArgumentException

unsupported format

Error message

unsupported format

What it means

Thrown by HeaderExtractor.getTime when the gRPC timestamp header value cannot be parsed as a long: Long.parseLong fails on the non-numeric timeStr, so the header is present but malformed. This is a validation guard telling the caller the remote peer sent an invalid time header, surfaced as IllegalArgumentException. The input at fault is the time header string; senders must emit epoch-millis as a decimal string, and receivers should treat this as a protocol violation from the client.

Source

Thrown at grpc/src/main/java/com/navercorp/pinpoint/grpc/server/HeaderExtractor.java:53

    public HeaderExtractor() {
        this(PinpointConstants.AGENT_ID_MAX_LEN, PinpointConstants.AGENT_NAME_MAX_LEN);
    }

    public HeaderExtractor(int idMaxLength, int nameMaxLength) {
        this.idMaxLength = idMaxLength;
        this.nameMaxLength = nameMaxLength;
    }

    public long getTime(Metadata headers, Metadata.Key<String> timeKey) {
        final String timeStr = headers.get(timeKey);
        if (timeStr == null) {
            throw new InvalidGrpcHeaderException(timeKey, timeKey.name() + " header is missing");
        }
        try {
            // check number format
            return Long.parseLong(timeStr);
        } catch (NumberFormatException e) {
            throw new IllegalArgumentException("unsupported format");
        }
    }

    public String getId(Metadata headers, Metadata.Key<String> idKey) {
        final String id = headers.get(idKey);
        if (id == null) {
            throw new InvalidGrpcHeaderException(idKey, idKey.name() + " header is missing");
        }
        return validateId(id, idKey);
    }

    public String getName(Metadata headers, Metadata.Key<String> idKey) {
        return getName(headers, idKey, this.nameMaxLength);
    }

    public String getName(Metadata headers, Metadata.Key<String> idKey, int maxNameLength) {
        final String name = headers.get(idKey);
        if (!StringUtils.isEmpty(name)) {

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Send the header as epoch millis in decimal digits with no whitespace
  2. Reject/fix the misbehaving client sending malformed headers
  3. Add a server-side guard that maps this to INVALID_ARGUMENT with the offending value
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at grpc/src/main/java/com/navercorp/pinpoint/grpc/server/HeaderExtractor.java:53 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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