{
  "id": "python/starlette-static-files-404",
  "signature": "INFO: 127.0.0.1:xxxxx - \"GET /static/style.css HTTP/1.1\" 404 Not Found",
  "signature_zh": "INFO: 127.0.0.1:xxxxx - \"GET /static/style.css HTTP/1.1\" 404 未找到",
  "regex": "INFO:\\ 127\\.0\\.0\\.1:xxxxx\\ \\-\\ \"GET\\ /static/style\\.css\\ HTTP/1\\.1\"\\ 404\\ Not\\ Found",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "StaticFiles was mounted with a directory that does not exist relative to the process working directory, or the mount path and URL prefix disagree.",
  "root_cause_type": "generic",
  "root_cause_zh": "StaticFiles 挂载的目录相对于进程工作目录不存在，或挂载路径与 URL 前缀不一致。",
  "versions": [
    {
      "version": "0.30+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Bypasses StaticFiles caching and content-type handling; fragile.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Shadows API routes registered after the mount.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "from pathlib import Path\nfrom fastapi.staticfiles import StaticFiles\nBASE = Path(__file__).resolve().parent\napp.mount('/static', StaticFiles(directory=BASE / 'static'), name='static')",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "assert (BASE / 'static').is_dir(), 'static dir missing'",
      "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-21",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}