{
  "id": "mongodb/oplog-query-no-more-cursors",
  "signature": "MongoServerError: OplogQueryNoMoreCursors: no more cursors available for query on namespace local.oplog.rs",
  "signature_zh": "MongoServerError: OplogQueryNoMoreCursors: 命名空间 local.oplog.rs 的查询没有更多可用游标",
  "regex": "OplogQueryNoMoreCursors: no more cursors available for query on namespace local\\.oplog\\.rs",
  "domain": "mongodb",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "The oplog query exhausted all available cursors due to a long-running change stream or tailing cursor without proper cleanup.",
  "root_cause_type": "generic",
  "root_cause_zh": "由于长时间运行的变更流或尾随游标未正确清理，oplog 查询耗尽了所有可用游标。",
  "versions": [
    {
      "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": "Restarting the mongod process temporarily clears cursors but doesn't prevent recurrence.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Increasing oplog size does not affect cursor count, only storage capacity.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Setting cursorTimeoutMillis to a higher value makes the problem worse by keeping cursors open longer.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Close stale change stream cursors by killing idle cursors: db.currentOp({‘$all’: true}) then db.killOp(opid) for cursors with secs_running > 300.",
      "success_rate": 0.9,
      "how": "Close stale change stream cursors by killing idle cursors: db.currentOp({‘$all’: true}) then db.killOp(opid) for cursors with secs_running > 300.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Reduce maxTimeMS on change streams to force automatic cursor expiration: db.collection.watch([], {maxTimeMS: 60000}).",
      "success_rate": 0.85,
      "how": "Reduce maxTimeMS on change streams to force automatic cursor expiration: db.collection.watch([], {maxTimeMS: 60000}).",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "关闭过期的变更流游标：使用 db.currentOp({'$all': true}) 查找游标，然后对 secs_running > 300 的游标执行 db.killOp(opid)。",
    "减少变更流的 maxTimeMS 以强制自动过期游标：db.collection.watch([], {maxTimeMS: 60000})。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.mongodb.com/docs/manual/reference/operator/aggregation/changeStream/",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2024-02-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}