{
  "id": "python/aiohttp-client-response-error",
  "signature": "aiohttp.client_exceptions.ClientResponseError: 429, message='Too Many Requests', url=URL('https://api.example.com/v1/items')",
  "signature_zh": "aiohttp.client_exceptions.ClientResponseError: 429, message='请求过于频繁', url=URL('https://api.example.com/v1/items')",
  "regex": "aiohttp\\.client_exceptions\\.ClientResponseError:\\ 429,\\ message='Too\\ Many\\ Requests',\\ url=URL\\('https://api\\.example\\.com/v1/items'\\)",
  "domain": "python",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The remote server returned a 4xx/5xx status and the session/request was configured with raise_for_status=True, so aiohttp raised ClientResponseError instead of returning the response.",
  "root_cause_type": "generic",
  "root_cause_zh": "远程服务器返回了 4xx/5xx 状态码，且会话/请求配置了 raise_for_status=True，因此 aiohttp 抛出 ClientResponseError 而非返回响应。",
  "versions": [
    {
      "version": "3.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Hides 5xx and auth failures; downstream code receives HTML error pages parsed as JSON.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Aggravates rate limiting and often escalates to a 403 block.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.88,
      "how": "import asyncio, random\nfor attempt in range(5):\n    async with session.get(url) as r:\n        if r.status == 429:\n            await asyncio.sleep((2 ** attempt) + random.random())\n            continue\n        r.raise_for_status()\n        return await r.json()",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "sem = asyncio.Semaphore(5)\nasync def fetch(u):\n    async with sem:\n        async with session.get(u) as r:\n            r.raise_for_status()\n            return await r.json()",
      "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.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-08-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}