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

  1. Inspect the raw multipart response (curl/logging) and correct the server or proxy to emit standard multipart/form-data parts.
  2. Ensure the response Content-Type multipart boundary/header is well-formed so Netty parses only real parts.
  3. Consume the body as raw String/InputStream and parse manually if the producer cannot be fixed.
  4. Upgrade Quarkus — part-parsing robustness changes across Netty/RESTEasy Reactive versions may alter behavior.
Defensive patterns

Strategy: fallback

Prevention

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


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/f17468ac522c17e9. Report an issue: GitHub.