{
  "id": "python/aiohttp-client-connector-http-version-error",
  "signature": "aiohttp.client_exceptions.ClientHttpVersionError: Invalid HTTP version: HTTP/2",
  "signature_zh": "aiohttp 客户端 HTTP 版本错误：无效的 HTTP 版本：HTTP/2",
  "regex": "aiohttp\\.client_exceptions\\.ClientHttpVersionError:\\ Invalid\\ HTTP\\ version:\\ HTTP/2",
  "domain": "python",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The server uses HTTP/2, but aiohttp is configured to use HTTP/1.1 only, or vice versa.",
  "root_cause_type": "generic",
  "root_cause_zh": "服务器使用 HTTP/2，但 aiohttp 配置为仅使用 HTTP/1.1，反之亦然。",
  "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": "Disabling HTTP/2 support entirely",
      "why_fails": "Some servers require HTTP/2 for optimal performance or functionality.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    },
    {
      "action": "Manually setting the HTTP version in headers",
      "why_fails": "The HTTP version is negotiated at the protocol level, not via headers.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Enable HTTP/2 support with aiohttp",
      "success_rate": 0.9,
      "how": "import aiohttp\nasync with aiohttp.ClientSession(http2=True) as session:\n    async with session.get(url) as resp:",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a custom connector with HTTP/2 enabled",
      "success_rate": 0.85,
      "how": "connector = aiohttp.TCPConnector(force_close=True, http2=True)\nasync with aiohttp.ClientSession(connector=connector) as session:",
      "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": "2025-09-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}