{"record":{"id":"9873529f9c13aa0f","repo":"quarkusio/quarkus","slug":"unsupported-multipart-message-element-type-expect","errorCode":null,"errorMessage":"Unsupported multipart message element type. Expected FileAttribute or Attribute, got: \" + httpData.getClass()","messagePattern":"Unsupported multipart message element type\\. Expected FileAttribute or Attribute, got: \" \\+ httpData\\.getClass\\(\\)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers/ClientResponseCompleteRestHandler.java","lineNumber":122,"sourceCode":"                        if (httpData instanceof Attribute at) {\n                            // TODO: get rid of ByteArrayInputStream\n                            // TODO: maybe we could extract something closer to input stream from attribute\n                            ByteArrayInputStream in = new ByteArrayInputStream(\n                                    at.getValue().getBytes(StandardCharsets.UTF_8));\n                            Object fieldValue = context.readEntity(in,\n                                    fieldFiller.getFieldType(),\n                                    MediaType.valueOf(fieldFiller.getMediaType()),\n                                    context.getMethodDeclaredAnnotationsSafe(),\n                                    // FIXME: we have strings, it wants objects, perhaps there's\n                                    // an Object->String conversion too many\n                                    (MultivaluedMap) responseContext.getHeaders());\n                            if (fieldValue != null) {\n                                fieldFiller.set(result, fieldValue);\n                            }\n                        } else if (httpData instanceof FileUpload fu) {\n                            fieldFiller.set(result, new FileDownloadImpl(fu));\n                        } else {\n                            throw new IllegalArgumentException(\"Unsupported multipart message element type. \" +\n                                    \"Expected FileAttribute or Attribute, got: \" + httpData.getClass());\n                        }\n                    }\n                } // close the else block for non-EntityPart multipart\n            } else {\n                Class<?> rawType = context.getResponseType().getRawType();\n                if (context.isFileDownload()) {\n                    if (File.class.equals(rawType)) {\n                        builder.entity(new File(context.getTmpFilePath()));\n                    } else if (Path.class.equals(rawType)) {\n                        builder.entity(Paths.get(context.getTmpFilePath()));\n                    } else {\n                        throw new IllegalStateException(\"Unhandled type: \" + rawType);\n                    }\n                    context.clearTmpFilePath();\n                } else if (!void.class.equals(rawType)) {\n                    Object entity = context.readEntity(entityStream,\n                            context.getResponseType(),","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers/ClientResponseCompleteRestHandler.java#L104-L140","documentation":"While filling a multipart response POJO, the handler iterates the Netty response parts and knows how to map Attribute (plain values) and FileUpload (files). Any other Netty InterfaceHttpData subtype encountered cannot be mapped onto the target class, so mapToResponse throws IllegalArgumentException.","triggerScenarios":"A multipart response contains a part whose Netty representation is neither Attribute nor FileUpload (e.g. an InternalAttribute/other internal data type), often due to malformed multipart content or an unexpected Content-Disposition structure produced by the server.","commonSituations":"Non-Java server (NGINX module, gateway) emitting non-standard multipart framing; proxy rewriting Content-Type boundaries; sending nested/complex part types the client mapping doesn't model.","solutions":["Inspect the raw response and fix the server (or proxy) to emit standard multipart/form-data parts (Attribute/FileUpload compatible).","Change the client method to return List<EntityPart> and process parts manually.","Verify each part has a proper Content-Disposition name matching an annotated field on the target @MultipartForm class.","Capture the response with a proxy/logger to identify the offending part type and adjust server serialization."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  List<EntityPart> parts = response.readEntity(new GenericType<List<EntityPart>>() {});\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"Unsupported multipart message element type\")) {\n    // fall back to raw body parsing / log offending part\n  } else { throw e; }\n}","preventionTips":["Verify server emits standard multipart/form-data parts","Check proxies/gateways don't rewrite multipart bodies","Prefer List<EntityPart> responses for non-Java producers"],"tags":["rest-client","multipart","netty","response-processing"],"backgroundTag":"unsupported-multipart-part-type","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}