{
  "id": "python/flask-redirect-endpoint-error",
  "signature": "werkzeug.routing.exceptions.BuildError: Could not build url for endpoint 'login'",
  "signature_zh": "Werkzeug路由异常：无法为端点'login'构建URL",
  "regex": "werkzeug\\.routing\\.exceptions\\.BuildError:\\ Could\\ not\\ build\\ url\\ for\\ endpoint\\ 'login'",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The endpoint name used in url_for or redirect does not match any defined route, or required parameters are missing.",
  "root_cause_type": "generic",
  "root_cause_zh": "url_for或redirect中使用的端点名称与任何定义的路由不匹配，或缺少必需的参数。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Using a hardcoded URL instead of url_for can break if routes change.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Adding a route with a different name does not fix the endpoint mismatch.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Check the route decorator: @app.route('/login', endpoint='login') or ensure the function name matches.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Provide required parameters: url_for('user_profile', username='john')",
      "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-25",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}