{
  "id": "python/requests-connectionerror-proxy-connection-reset",
  "signature": "requests.exceptions.ConnectionError: HTTPConnectionPool(host='proxy.example.com', port=8080): Max retries exceeded with url: http://target.com/ (Caused by ProxyError('Cannot connect to proxy.', ConnectionResetError(104, 'Connection reset by peer')))",
  "signature_zh": "requests.exceptions.ConnectionError: HTTPConnectionPool(host='proxy.example.com', port=8080): 超过最大重试次数 (由ProxyError('无法连接到代理。', ConnectionResetError(104, '连接被对端重置'))引起)",
  "regex": "requests\\.exceptions\\.ConnectionError:\\ HTTPConnectionPool\\(host='proxy\\.example\\.com',\\ port=8080\\):\\ Max\\ retries\\ exceeded\\ with\\ url:\\ http://target\\.com/\\ \\(Caused\\ by\\ ProxyError\\('Cannot\\ connect\\ to\\ proxy\\.',\\ ConnectionResetError\\(104,\\ 'Connection\\ reset\\ by\\ peer'\\)\\)\\)",
  "domain": "python",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The proxy server abruptly closed the connection, possibly due to timeout or overload.",
  "root_cause_type": "generic",
  "root_cause_zh": "代理服务器突然关闭连接，可能是由于超时或过载。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Retrying immediately with the same proxy",
      "why_fails": "The proxy may still be overloaded or resetting connections.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Increasing the number of retries",
      "why_fails": "Retries may succeed temporarily but the underlying proxy issue persists.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use a different proxy server",
      "success_rate": 0.85,
      "how": "proxies = {'http': 'http://new-proxy.example.com:8080'}\nrequests.get('http://target.com', proxies=proxies)",
      "condition": "",
      "sources": []
    },
    {
      "action": "Add a delay between connection attempts to avoid overwhelming the proxy",
      "success_rate": 0.75,
      "how": "import time\nfor _ in range(3):\n    try:\n        response = requests.get('http://target.com', proxies=proxies)\n        break\n    except requests.exceptions.ConnectionError:\n        time.sleep(2)",
      "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": "partial",
  "first_seen": "2024-11-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}