{"record":{"id":"a2de73bbf41c53c2","repo":"quarkusio/quarkus","slug":"attribute-bigger-than-maxsize-allowed","errorCode":null,"errorMessage":"Attribute bigger than maxSize allowed","messagePattern":"Attribute bigger than maxSize allowed","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":203,"sourceCode":"            Attribute attribute = new MixedAttribute(name, definedSize, minSize, charset, baseDir, deleteOnExit);\n            attribute.setMaxSize(maxSize);\n            List<HttpData> list = getList(response);\n            list.add(attribute);\n            return attribute;\n        }\n        MemoryAttribute attribute = new MemoryAttribute(name, definedSize);\n        attribute.setMaxSize(maxSize);\n        return attribute;\n    }\n\n    /**\n     * Utility method\n     */\n    private static void checkHttpDataSize(HttpData data) {\n        try {\n            data.checkSize(data.length());\n        } catch (IOException ignored) {\n            throw new IllegalArgumentException(\"Attribute bigger than maxSize allowed\");\n        }\n    }\n\n    public Attribute createAttribute(HttpClientResponse response, String name, String value) {\n        if (useDisk) {\n            Attribute attribute;\n            try {\n                attribute = new DiskAttribute(name, value, charset, baseDir, deleteOnExit);\n                attribute.setMaxSize(maxSize);\n            } catch (IOException e) {\n                // revert to Mixed mode\n                attribute = new MixedAttribute(name, value, minSize, charset, baseDir, deleteOnExit);\n                attribute.setMaxSize(maxSize);\n            }\n            checkHttpDataSize(attribute);\n            List<HttpData> list = getList(response);\n            list.add(attribute);\n            return attribute;","sourceCodeStart":185,"sourceCodeEnd":221,"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#L185-L221","documentation":"QuarkusMultipartResponseDataFactory.checkHttpDataSize calls Netty's HttpData.checkSize(length) and converts the resulting IOException (thrown when the incoming attribute/file exceeds the configured maxSize) into this IllegalArgumentException. The factory protects the client from unbounded memory/disk use while parsing a multipart response. The original size violation detail is discarded in this variant.","triggerScenarios":"Receiving a multipart response whose individual part (attribute or file) is larger than the maxSize configured on the QuarkusMultipartResponseDataFactory (default derived from Netty DiskAttribute/DiskFileUpload defaults unless overridden).","commonSituations":"Downloading large files via a multipart-consuming endpoint with the default max size still in effect; server sending bigger attachments than the client was configured for; unit tests with large generated payloads.","solutions":["Increase the max size via DiskAttribute.setMaxSize(...)/DiskFileUpload.setMaxSize(...) or the factory's maxSize setting before parsing","Stream large files to disk (useDisk with a configured base directory) instead of keeping them in memory","If the server payload is unexpectedly large, fix the server or filter which parts the client requests"],"exampleFix":"// before\nparts = factory.parseResponse(response); // default max size in effect\n// after\nDiskAttribute.setMaxSize(1024L * 1024L * 1024L); // 1GB\nDiskFileUpload.setMaxSize(1024L * 1024L * 1024L);\nparts = factory.parseResponse(response);","handlingStrategy":"validation","validationCode":"DiskAttribute.setMaxSize(maxUploadBytes);\nDiskFileUpload.setMaxSize(maxUploadBytes);\n// or configure maxSize on the QuarkusMultipartResponseDataFactory before parsing","typeGuard":null,"tryCatchPattern":"try {\n    parts = parseMultipartResponse(response);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"bigger than maxSize\")) {\n        throw new ResponseTooLargeException(e.getMessage(), e);\n    }\n    throw e;\n}","preventionTips":["Set Netty DiskAttribute/DiskFileUpload max sizes to match the largest expected server payload","Check Content-Length before parsing large multipart responses","Use disk-backed storage for large file parts"],"tags":["multipart","size-limit","netty","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"}