{"record":{"id":"402f2bfcf960710d","repo":"quarkusio/quarkus","slug":"attribute-bigger-than-maxsize-allowed-wrapped-ioe","errorCode":null,"errorMessage":"Attribute bigger than maxSize allowed (wrapped IOException from data.checkSize)","messagePattern":"Attribute bigger than maxSize allowed \\(wrapped IOException from data\\.checkSize\\)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/multipart/QuarkusMultipartResponseDataFactory.java","lineNumber":237,"sourceCode":"            List<HttpData> list = getList(response);\n            list.add(attribute);\n            return attribute;\n        }\n        if (checkSize) {\n            Attribute attribute = new MixedAttribute(name, value, minSize, charset, baseDir, deleteOnExit);\n            attribute.setMaxSize(maxSize);\n            checkHttpDataSize(attribute);\n            List<HttpData> list = getList(response);\n            list.add(attribute);\n            return attribute;\n        }\n        try {\n            MemoryAttribute attribute = new MemoryAttribute(name, value, charset);\n            attribute.setMaxSize(maxSize);\n            checkHttpDataSize(attribute);\n            return attribute;\n        } catch (IOException e) {\n            throw new IllegalArgumentException(e);\n        }\n    }\n\n    // to reuse netty stuff as much as possible, we use FileUpload class to represent the downloaded file\n    // the difference between this and the original is that we always use DiskFileUpload\n    public FileUpload createFileUpload(HttpClientResponse response, String name, String filename,\n            String contentType, String contentTransferEncoding, Charset charset,\n            long size) {\n        FileUpload fileUpload = new DiskFileUpload(name, filename, contentType,\n                contentTransferEncoding, charset, size, baseDir, deleteOnExit);\n        fileUpload.setMaxSize(maxSize);\n        checkHttpDataSize(fileUpload);\n        List<HttpData> list = getList(response);\n        list.add(fileUpload);\n        return fileUpload;\n    }\n\n    public void removeHttpDataFromClean(HttpClientResponse response, InterfaceHttpData data) {","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/multipart/QuarkusMultipartResponseDataFactory.java#L219-L255","documentation":"In QuarkusMultipartResponseDataFactory.createAttribute, after building a MemoryAttribute the factory checks its size against maxSize; when the check fails the resulting IOException is wrapped in an IllegalArgumentException. Unlike the static checkHttpDataSize path, this variant preserves the original IOException as the cause for debugging. It exists to cap memory usage when parsing inbound multipart attributes.","triggerScenarios":"Calling createAttribute(response, name, value) with a value whose byte length (in the configured charset) exceeds the factory's maxSize, causing MemoryAttribute.setMaxSize/checkSize to throw an IOException that gets wrapped.","commonSituations":"Server returning very large form fields in a multipart response while the client uses defaults; multi-byte charsets (UTF-8) inflating byte length beyond the expected char count; maxSize configured too small for the API payload.","solutions":["Raise the configured maxSize on the factory / DiskAttribute.setMaxSize before parsing the response","Handle the wrapped cause explicitly: catch IllegalArgumentException and inspect getCause() instanceof IOException to report size limits to users","Switch to disk-backed storage (useDisk) so large attributes spill to files instead of memory"],"exampleFix":"// before\ntry {\n    parts = factory.parseResponse(response);\n} catch (IllegalArgumentException e) {\n    log.error(\"parse failed\", e);\n}\n// after\ntry {\n    parts = factory.parseResponse(response);\n} catch (IllegalArgumentException e) {\n    if (e.getCause() instanceof IOException) {\n        throw new ResponseTooLargeException(\"multipart attribute exceeded maxSize\", e);\n    }\n    throw e;\n}","handlingStrategy":"try-catch","validationCode":"DiskAttribute.setMaxSize(expectedMaxBytes); // before response parsing","typeGuard":null,"tryCatchPattern":"try {\n    Attribute attr = factory.createAttribute(response, name, value);\n} catch (IllegalArgumentException e) {\n    Throwable cause = e.getCause();\n    if (cause instanceof IOException) {\n        throw new ResponseTooLargeException(\"attribute exceeded maxSize: \" + name, e);\n    }\n    throw e;\n}","preventionTips":["Inspect getCause() to distinguish size-limit failures from other IllegalArgumentExceptions","Raise maxSize before parsing if payloads are known to be large","Prefer disk-backed attributes for unbounded server payloads","Estimate byte-length (not char-length) against limits for multi-byte charsets"],"tags":["multipart","size-limit","netty","memory","rest-client"],"backgroundTag":"payload-too-large","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}