{
  "id": "python/flask-abort-assertion-error",
  "signature": "AssertionError: View function mapping is overwriting an existing endpoint function: index",
  "signature_zh": "断言错误：视图函数映射正在覆盖现有的端点函数：index",
  "regex": "AssertionError:\\ View\\ function\\ mapping\\ is\\ overwriting\\ an\\ existing\\ endpoint\\ function:\\ index",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Multiple route decorators applied to the same function name or a view function registered twice with the same endpoint name.",
  "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": "",
      "why_fails": "The endpoint defaults to the function name; if the path is the same, Flask still sees a conflict if the old function isn't removed.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Flask uses the function name as the endpoint by default, causing overwrite unless explicit endpoint is given.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Specify different endpoint names in each decorator: @app.route('/a', endpoint='a_func') and @app.route('/b', endpoint='b_func')",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Use unique function names for each route: def index_a(): return 'A' and def index_b(): return 'B'",
      "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-03-15",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}