quarkusio/quarkus · error · IllegalArgumentException
Unsupported multipart response element type: " + httpData.ge
Error message
Unsupported multipart response element type: " + httpData.getClass()
What it means
nettyPartToEntityPart converts a single Netty multipart part into a client EntityPart. It supports FileUpload and Attribute; any other InterfaceHttpData subtype cannot be converted and throws IllegalArgumentException listing the concrete class.
Source
Thrown at independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers/ClientResponseCompleteRestHandler.java:178
}
private static EntityPart nettyPartToEntityPart(InterfaceHttpData httpData, Serialisers serialisers) throws IOException {
String name = httpData.getName();
String fileName = null;
InputStream content;
MediaType mediaType;
MultivaluedMap<String, String> headers = new QuarkusMultivaluedHashMap<>();
if (httpData instanceof FileUpload fu) {
fileName = fu.getFilename();
String ct = fu.getContentType();
mediaType = ct != null ? MediaType.valueOf(ct) : MediaType.APPLICATION_OCTET_STREAM_TYPE;
content = new ByteArrayInputStream(fu.get());
} else if (httpData instanceof Attribute at) {
mediaType = MediaType.TEXT_PLAIN_TYPE;
content = new ByteArrayInputStream(at.getValue().getBytes(StandardCharsets.UTF_8));
} else {
throw new IllegalArgumentException(
"Unsupported multipart response element type: " + httpData.getClass());
}
headers.putSingle("Content-Type", mediaType.toString());
headers.putSingle("Content-Disposition", EntityPartImpl.buildContentDisposition(name, fileName));
return new EntityPartImpl(name, fileName, headers, mediaType, content, serialisers);
}
}
View on GitHub (pinned to e1c734241f)
Solutions
- Inspect the raw multipart response (curl/logging) and correct the server or proxy to emit standard multipart/form-data parts.
- Ensure the response Content-Type multipart boundary/header is well-formed so Netty parses only real parts.
- Consume the body as raw String/InputStream and parse manually if the producer cannot be fixed.
- Upgrade Quarkus — part-parsing robustness changes across Netty/RESTEasy Reactive versions may alter behavior.
Defensive patterns
Strategy: fallback
Prevention
- Fall back to raw-body consumption when part types are uncertain
- Validate producer's multipart framing with curl before wiring the client
- Pin/upgrade Quarkus and Netty versions for improved parsing
When it happens
Trigger: Reading a multipart response as List<EntityPart> where the parsed parts include a Netty data type other than FileUpload/Attribute (e.g. InternalAttribute from non-standard multipart framing).
Common situations: Server or intermediary emitting malformed/extra boundary or preamble parts; gateways rewriting multipart content; unusual Content-Type headers causing Netty's decoder to produce internal attribute parts.
Related errors
- Unsupported multipart message element type. Expected FileAtt
- Attribute bigger than maxSize allowed
- Attribute bigger than maxSize allowed (wrapped IOException f
- PartType annotation is only supported on fields and (setter/
- Primitive types are not supported for multipart response map
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/f17468ac522c17e9.
Report an issue: GitHub.