{"record":{"id":"c69f6ac863655315","repo":"infiniflow/ragflow","slug":"max-body-size-exceeds-maximum-allowed-size-10mb","errorCode":null,"errorMessage":"max_body_size exceeds maximum allowed size (10MB)","messagePattern":"max_body_size exceeds maximum allowed size \\(10MB\\)","errorType":"exception","errorClass":"Exception","httpStatus":400,"severity":"error","filePath":"api/apps/restful_apis/agent_api.py","lineNumber":1946,"sourceCode":"    async def _validate_max_body_size(security_cfg):\n        \"\"\"Check request size does not exceed max_body_size.\"\"\"\n        max_size = security_cfg.get(\"max_body_size\")\n        if not max_size:\n            max_size = \"10MB\"\n\n        # Convert \"10MB\" → bytes\n        units = {\"kb\": 1024, \"mb\": 1024**2}\n        size_str = max_size.lower()\n\n        for suffix, factor in units.items():\n            if size_str.endswith(suffix):\n                limit = int(size_str.replace(suffix, \"\")) * factor\n                break\n        else:\n            raise Exception(\"Invalid max_body_size format\")\n        MAX_LIMIT = 10 * 1024 * 1024  # 10MB\n        if limit > MAX_LIMIT:\n            raise Exception(\"max_body_size exceeds maximum allowed size (10MB)\")\n\n        content_length = request.content_length or 0\n        if content_length > limit:\n            raise Exception(f\"Request body too large: {content_length} > {limit}\")\n\n    def _validate_ip_whitelist(security_cfg):\n        \"\"\"Allow only IPs listed in ip_whitelist.\"\"\"\n        whitelist = security_cfg.get(\"ip_whitelist\", [])\n        if not whitelist:\n            return\n\n        client_ip = request.remote_addr\n\n        for rule in whitelist:\n            if \"/\" in rule:\n                # CIDR notation\n                if ipaddress.ip_address(client_ip) in ipaddress.ip_network(rule, strict=False):\n                    return","sourceCodeStart":1928,"sourceCodeEnd":1964,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/api/apps/restful_apis/agent_api.py#L1928-L1964","documentation":"Error \"max_body_size exceeds maximum allowed size (10MB)\" thrown in infiniflow/ragflow.","triggerScenarios":"Thrown at api/apps/restful_apis/agent_api.py:1946 when the library encounters an invalid state.","commonSituations":"The configured webhook body limit exceeds the hard 10MB cap; reducing the limit prevents this error.","solutions":["Lower max_body_size to 10MB or less."],"exampleFix":"webhook_config = {'max_body_size': '10MB'}","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}