{
  "id": "mongodb/wiredtiger-file-close-failed",
  "signature": "WiredTiger error (3) __wt_file_handle_close, file: WiredTiger.wt, close: No such file or directory",
  "signature_zh": "WiredTiger 错误 (3) __wt_file_handle_close，文件：WiredTiger.wt，关闭：没有那个文件或目录",
  "regex": "WiredTiger error \\(3\\) __wt_file_handle_close.*No such file or directory",
  "domain": "mongodb",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "The WiredTiger storage engine failed to close a file handle, typically due to a filesystem-level corruption or a stale NFS mount causing the underlying file to be deleted while MongoDB still held a reference.",
  "root_cause_type": "generic",
  "root_cause_zh": "WiredTiger 存储引擎无法关闭文件句柄，通常是由于文件系统级损坏或过时的 NFS 挂载导致底层文件在 MongoDB 仍持有引用时被删除。",
  "versions": [
    {
      "version": "MongoDB 5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "MongoDB 6.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "MongoDB 7.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The corruption persists in the WiredTiger metadata; restarting only re-encounters the same error or causes a crash loop.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This file contains critical storage engine metadata; removing it makes the database unreadable and requires a full resync from replica set or backup.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Running fsck on a mounted filesystem can cause further corruption; MongoDB requires the data directory to be consistent before repair.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Stop mongod, run `mongod --repair` on the data directory, then restart. This rebuilds WiredTiger metadata from remaining data files.",
      "success_rate": 0.7,
      "how": "Stop mongod, run `mongod --repair` on the data directory, then restart. This rebuilds WiredTiger metadata from remaining data files.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Restore from a recent backup if repair fails. Use `mongorestore` with the backup dump.",
      "success_rate": 0.9,
      "how": "Restore from a recent backup if repair fails. Use `mongorestore` with the backup dump.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If using a replica set, remove the affected node, resync from the primary by clearing the data directory and restarting with `--replSet`.",
      "success_rate": 0.85,
      "how": "If using a replica set, remove the affected node, resync from the primary by clearing the data directory and restarting with `--replSet`.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "停止 mongod，在数据目录上运行 `mongod --repair`，然后重新启动。这会从剩余的数据文件中重建 WiredTiger 元数据。",
    "如果修复失败，从最近的备份恢复。使用 `mongorestore` 恢复备份转储。",
    "如果使用副本集，删除受影响的节点，清空数据目录并用 `--replSet` 重新启动，从主节点重新同步。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.mongodb.com/docs/manual/tutorial/recover-data-following-unexpected-shutdown/",
  "official_doc_section": null,
  "error_code": "3",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.75,
  "resolvable": "partial",
  "first_seen": "2023-03-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}