pinpoint-apm/pinpoint · error · IllegalArgumentException
unsupported message
Error message
unsupported message
What it means
AgentGrpcDataSender.request(MetaDataType) converts the input via a message converter and requires the resulting protobuf message to be PAgentInfo; anything else means the wrong DataType was routed to the agent-info sender. It throws IllegalArgumentException naming the offending object.
Source
Thrown at agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/sender/grpc/AgentGrpcDataSender.java:91
private AgentGrpc.AgentStub newAgentPingStub() {
AgentGrpc.AgentStub agentStub = AgentGrpc.newStub(managedChannel);
return agentStub.withInterceptors(new SocketIdClientInterceptor());
}
private PingStreamContext newPingStream(AgentGrpc.AgentStub agentStub, ScheduledExecutorService reconnectScheduler) {
final PingStreamContext pingStreamContext = new PingStreamContext(agentStub, reconnector, reconnectScheduler);
logger.info("newPingStream:{}", pingStreamContext);
return pingStreamContext;
}
@Override
public CompletableFuture<ResultResponse> request(MetaDataType data) {
final GeneratedMessageV3 message = this.messageConverter.toMessage(data);
if (!(message instanceof PAgentInfo)) {
throw new IllegalArgumentException("unsupported message " + data);
}
final PAgentInfo pAgentInfo = (PAgentInfo) message;
CompletableFutureObserver<PResult, ResultResponse> observer = new CompletableFutureObserver<>(PResults::toResponse);
this.agentInfoStub.requestAgentInfo(pAgentInfo, observer);
return observer.future();
}
@Override
public void close() {
if (shutdown) {
return;
}
this.shutdown = true;
logger.info("Stop {}, channel={}", name, managedChannel);View on GitHub (pinned to 744c3d3075)
Solutions
- Ensure only AgentInfo (MetaDataType converting to PAgentInfo) is passed to AgentGrpcDataSender.request
- Route other metadata types to their dedicated senders (e.g. metadata sender / SpanGrpcDataSender)
- Verify the configured MessageConverter<MetaDataType,...> maps the type to PAgentInfo
Example fix
// before agentSender.request(apiMetaData); // after metadataSender.request(apiMetaData); agentSender.request(agentInfo);
Defensive patterns
Strategy: type-guard
Validate before calling
if (!(messageConverter.toMessage(data) instanceof PAgentInfo)) { throw new IllegalArgumentException("AgentGrpcDataSender requires AgentInfo data"); } Type guard
GeneratedMessageV3 msg = messageConverter.toMessage(data);
if (msg instanceof PAgentInfo pAgentInfo) { /* safe to send */ } Try / catch
try { return agentSender.request(data); } catch (IllegalArgumentException e) { log.error("Wrong data type for agent sender: {}", data, e); throw; } Prevention
- Keep one sender per metadata type and route via typed interfaces
- Add unit tests asserting converter output types per sender
- Avoid generic MetaDataType queues feeding a single sender
When it happens
Trigger: Calling request(data) with a MetaDataType whose converted GeneratedMessageV3 is not a PAgentInfo — e.g. passing ApiMetaData or SqlMetaData to the AgentGrpcDataSender instead of AgentInfo.
Common situations: Wiring the wrong gRPC sender bean/stub in custom code, a refactored converter mapping a new metadata type incorrectly, or calling request() with mixed metadata from a queue meant only for agent info.
Understand the failure class
Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.
Related errors
- Unexpected TraceId type: ${traceId}
- list size not same
- spanEventList is empty.
- first SpanEvent is null
- unsupported type:${dataType}
AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07).
Data as JSON: /api/errors/fb80a171b08b8a1a.
Report an issue: GitHub.