{
  "id": "data/mongodb-cursor-timeout-exceeded",
  "signature": "MongoDB CursorNotFoundException: cursor not found on server after timeout",
  "signature_zh": "MongoDB游标未找到异常：超时后服务器上找不到游标",
  "regex": "CursorNotFound: cursor .+ not found on server",
  "domain": "data",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "MongoDB server-side cursors have a default idle timeout of 10 minutes; if the client pauses iteration beyond this time, the server garbage-collects the cursor, causing the next getMore call to fail.",
  "root_cause_type": "generic",
  "root_cause_zh": "MongoDB服务端游标的默认空闲超时时间为10分钟；如果客户端暂停迭代超过此时间，服务器会回收游标，导致下一次getMore调用失败。",
  "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 cursor still expires on the server regardless of batch size if no activity occurs.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "maxTimeMS controls query runtime, not cursor lifetime.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Enable noCursorTimeout on the cursor to prevent server-side garbage collection, but ensure you manually close the cursor to avoid resource leaks.",
      "success_rate": 0.95,
      "how": "Enable noCursorTimeout on the cursor to prevent server-side garbage collection, but ensure you manually close the cursor to avoid resource leaks.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Re-query with a filter on a timestamp field or use aggregation with $match to restart iteration from the last processed document.",
      "success_rate": 0.78,
      "how": "Re-query with a filter on a timestamp field or use aggregation with $match to restart iteration from the last processed document.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Enable noCursorTimeout on the cursor to prevent server-side garbage collection, but ensure you manually close the cursor to avoid resource leaks.",
    "Re-query with a filter on a timestamp field or use aggregation with $match to restart iteration from the last processed document."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.mongodb.com/docs/manual/reference/method/cursor.noCursorTimeout/",
  "official_doc_section": null,
  "error_code": "CursorNotFound",
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-06-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}