{
  "id": "python/starlette-route-mount-conflict",
  "signature": "ValueError: A route with the same path already exists.",
  "signature_zh": "值错误: 具有相同路径的路由已存在。",
  "regex": "ValueError:\\ A\\ route\\ with\\ the\\ same\\ path\\ already\\ exists\\.",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "在Starlette应用中重复注册相同路径的路由，导致冲突。",
  "root_cause_type": "generic",
  "root_cause_zh": "在Starlette应用中重复注册相同路径的路由，导致冲突。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "尝试覆盖路由而不删除旧路由",
      "why_fails": "框架不允许重复注册。",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "使用不同的HTTP方法但路径相同",
      "why_fails": "Starlette允许相同路径不同方法，但若方法也相同则冲突。",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "删除旧路由再注册新路由",
      "success_rate": 0.85,
      "how": "from starlette.routing import Route; routes = [route for route in app.routes if route.path != '/existing']; routes.append(Route('/existing', endpoint=new_handler)); app.router.routes = routes",
      "condition": "",
      "sources": []
    },
    {
      "action": "使用不同的路径或添加版本前缀",
      "success_rate": 0.95,
      "how": "app.add_route('/v2/existing', new_handler)",
      "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.84,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-03-22",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}