{
  "id": "python/django-user-creation-race",
  "signature": "django.db.utils.IntegrityError: UNIQUE constraint failed: auth_user.username",
  "signature_zh": "Django数据库完整性错误：唯一约束失败：auth_user.username",
  "regex": "django\\.db\\.utils\\.IntegrityError:\\ UNIQUE\\ constraint\\ failed:\\ auth_user\\.username",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "Two concurrent requests attempt to create a user with the same username.",
  "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": "User isn't created, but no feedback given; data loss.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Still can raise IntegrityError under concurrency.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Use transaction.atomic() and select_for_update to lock the row before checking existence.",
      "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-11-03",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}