{
  "id": "python/starlette-uvicorn-address-already-in-use",
  "signature": "OSError: [Errno 98] Address already in use",
  "signature_zh": "OSError: [Errno 98] 地址已被占用。",
  "regex": "OSError:\\ \\[Errno\\ 98\\]\\ Address\\ already\\ in\\ use",
  "domain": "python",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "A previous server process is still bound to the port (e.g., uvicorn --reload left a zombie, or another app holds 8000).",
  "root_cause_type": "generic",
  "root_cause_zh": "之前的服务器进程仍占用该端口（如 uvicorn --reload 遗留僵尸进程，或其他应用占用 8000）。",
  "versions": [
    {
      "version": "0.30+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Zombie process survives terminal close.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "uvicorn already sets it; a live listener still blocks.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.97,
      "how": "lsof -i :8000 | awk 'NR>1{print $2}' | xargs kill -9\n# Windows:\nnetstat -ano | findstr :8000",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.95,
      "how": "uvicorn main:app --port 8001",
      "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.9,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-01-15",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}