{
  "id": "python/flask-url-build-error-endpoint",
  "signature": "werkzeug.routing.exceptions.BuildError: Could not build url for endpoint 'index'",
  "signature_zh": "Werkzeug路由构建错误：无法为端点 'index' 构建URL",
  "regex": "werkzeug\\.routing\\.exceptions\\.BuildError:\\ Could\\ not\\ build\\ url\\ for\\ endpoint\\ 'index'",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The endpoint name is misspelled or the route does not exist.",
  "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": "Adding a random URL parameter to the url_for function.",
      "why_fails": "The endpoint still does not exist; parameters only work for existing routes.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using the function name instead of the endpoint name incorrectly.",
      "why_fails": "If the endpoint is explicitly set, the function name may not match.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Check the defined routes and ensure the endpoint name is correct.",
      "success_rate": 0.9,
      "how": "print(app.url_map)  # List all routes and endpoints",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use the correct endpoint name in url_for.",
      "success_rate": 0.95,
      "how": "url_for('home')  # Replace 'home' with the actual endpoint",
      "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-04-12",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}