{
  "id": "python/jinja2-undefined-user",
  "signature": "jinja2.exceptions.UndefinedError: 'user' is undefined",
  "signature_zh": "jinja2.exceptions.UndefinedError: 'user' 未定义",
  "regex": "jinja2\\.exceptions\\.UndefinedError:\\ 'user'\\ is\\ undefined",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Template references a variable that was not passed to render_template or is missing from the context dict.",
  "root_cause_type": "generic",
  "root_cause_zh": "模板引用了未传给 render_template 或上下文字典中缺失的变量。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Silently renders empty output instead of surfacing the missing data.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Hides the real problem and breaks required logic.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "return render_template('profile.html', user=current_user)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "app.jinja_env.undefined = jinja2.StrictUndefined",
      "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.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-05-02",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}