{
  "id": "python/starlette-static-file-not-found",
  "signature": "HTTPException: 404 Not Found: /static/style.css",
  "signature_zh": "HTTP 异常：404 未找到：/static/style.css",
  "regex": "HTTPException:\\ 404\\ Not\\ Found:\\ /static/style\\.css",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "Starlette 静态文件目录配置错误或文件不存在",
  "root_cause_type": "generic",
  "root_cause_zh": "Starlette 静态文件目录配置错误或文件不存在",
  "versions": [
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "将静态文件放在根目录并直接访问",
      "why_fails": "Starlette 不自动提供文件服务",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "使用 Flask 的静态文件方式",
      "why_fails": "Starlette 配置语法不同",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "挂载静态文件目录",
      "success_rate": 0.95,
      "how": "from starlette.staticfiles import StaticFiles\napp.mount('/static', StaticFiles(directory='static'), name='static')",
      "condition": "",
      "sources": []
    },
    {
      "action": "检查文件路径和权限",
      "success_rate": 0.9,
      "how": "ls -la static/style.css\nchmod 644 static/style.css",
      "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": "2025-02-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}