{
  "id": "python/uvicorn-port-already-in-use",
  "signature": "[Errno 98] error while attempting to bind on address ('0.0.0.0', 8000): address already in use",
  "signature_zh": "[Errno 98] 尝试绑定地址 ('0.0.0.0', 8000) 时出错：地址已被占用",
  "regex": "\\[Errno\\ 98\\]\\ error\\ while\\ attempting\\ to\\ bind\\ on\\ address\\ \\('0\\.0\\.0\\.0',\\ 8000\\):\\ address\\ already\\ in\\ use",
  "domain": "python",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "Previous uvicorn/gunicorn worker still holding the port, or another service bound to 8000 (common after Ctrl+C on reload).",
  "root_cause_type": "generic",
  "root_cause_zh": "先前的 uvicorn/gunicorn 工作进程仍占用端口，或另一服务绑定到 8000（reload 下 Ctrl+C 后常见）。",
  "versions": [
    {
      "version": "0.100+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "0.110+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Reload spawns more workers; port stays held.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Same port conflict.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "lsof -i :8000  # then kill -9 <pid>",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "uvicorn app:app --port 8001  # use a free port",
      "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.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-01-08",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}