{
  "id": "python/aiohttp-cannot-connect-to-host-name-not-known",
  "signature": "aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host api.internal:443 ssl:default [Name or service not known]",
  "signature_zh": "aiohttp.client_exceptions.ClientConnectorError: 无法连接到主机 api.internal:443 ssl:default [名称或服务未知]",
  "regex": "aiohttp\\.client_exceptions\\.ClientConnectorError:\\ Cannot\\ connect\\ to\\ host\\ api\\.internal:443\\ ssl:default\\ \\[Name\\ or\\ service\\ not\\ known\\]",
  "domain": "python",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "DNS resolution failed for the hostname; inside containers this often means the resolver config (/etc/resolv.conf) or the hostname itself is wrong, or async DNS is blocked.",
  "root_cause_type": "generic",
  "root_cause_zh": "主机名的 DNS 解析失败；在容器中通常意味着解析配置（/etc/resolv.conf）或主机名本身有误，或者异步 DNS 被阻止。",
  "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": "The failure is DNS, not TLS; disabling SSL has no effect on name resolution.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Resolution fails immediately with NXDOMAIN; waiting longer does not help.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "import socket\nsocket.getaddrinfo('api.internal', 443)  # test from Python\n# then: cat /etc/resolv.conf and ensure the nameserver is reachable",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.82,
      "how": "try:\n    import aiodns\n    conn = aiohttp.TCPConnector(resolver=aiohttp.AsyncResolver())\nexcept ImportError:\n    conn = aiohttp.TCPConnector()  # default ThreadedResolver",
      "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.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-08-19",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}