{
  "id": "python/aiohttp-client-connector-http-redirect-error",
  "signature": "aiohttp.client_exceptions.TooManyRedirects: Exceeded 30 redirects",
  "signature_zh": "aiohttp 客户端异常：超过 30 次重定向",
  "regex": "aiohttp\\.client_exceptions\\.TooManyRedirects:\\ Exceeded\\ 30\\ redirects",
  "domain": "python",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The server is redirecting the client in a loop or too many times, exceeding the default redirect limit.",
  "root_cause_type": "generic",
  "root_cause_zh": "服务器在循环中重定向客户端或重定向次数过多，超过了默认重定向限制。",
  "versions": [
    {
      "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"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Increasing the max redirects to a very high number",
      "why_fails": "This may cause infinite loops or resource exhaustion.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "Following redirects manually without checking for loops",
      "why_fails": "Manual following may still get stuck in a redirect loop.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Set max_redirects to a reasonable limit and handle redirect loops",
      "success_rate": 0.85,
      "how": "async with session.get(url, max_redirects=5) as resp:\n    # process response",
      "condition": "",
      "sources": []
    },
    {
      "action": "Disable automatic redirects and handle manually with loop detection",
      "success_rate": 0.8,
      "how": "async with session.get(url, allow_redirects=False) as resp:\n    if resp.status in (301, 302):\n        new_url = resp.headers['Location']\n        # check for loop before following",
      "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.82,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2026-01-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}