{
  "id": "python/starlette-memory-upload-too-large",
  "signature": "starlette.exceptions.HTTPException: 413 Request Entity Too Large",
  "signature_zh": "Starlette HTTP 异常：413 请求实体过大。",
  "regex": "starlette\\.exceptions\\.HTTPException:\\ 413\\ Request\\ Entity\\ Too\\ Large",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "Uploaded file size exceeds server's maximum request body size limit (default 1MB in Starlette).",
  "root_cause_type": "generic",
  "root_cause_zh": "上传的文件大小超过服务器的最大请求体大小限制（Starlette 默认 1MB）。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Application still enforces its own limit; must configure both.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Starlette reads entire body into memory before processing; limit applies first.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "In Starlette, set max request size: app = Starlette(max_request_size=10*1024*1024) # 10MB",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Use streaming upload: async def upload(request):\n    async for chunk in request.stream():\n        process(chunk)",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.81,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-08-22",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}