{
  "id": "mongodb/cannot-drop-index-on-system-collection",
  "signature": "MongoServerError: can't drop index on system collection",
  "signature_zh": "MongoServerError：无法删除系统集合上的索引",
  "regex": "can't drop index on system collection",
  "domain": "mongodb",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "Attempted to drop an index on a system collection (e.g., system.views, system.profile) which is restricted by MongoDB's internal protections.",
  "root_cause_type": "generic",
  "root_cause_zh": "尝试删除系统集合（如 system.views、system.profile）上的索引，但 MongoDB 内部保护机制禁止此类操作。",
  "versions": [],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Using db.collection.dropIndex() on a system collection with force:true ignores the error but corrupts internal metadata, leading to server crash or data loss.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Changing the collection name to a non-system prefix (e.g., 'my_views') and re-creating indexes doesn't fix the original system collection; the error persists.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use db.adminCommand({dropIndexes: 'admin.system.views', index: 'my_index_name'}) as a superuser, but only if absolutely necessary and after backing up the collection.",
      "success_rate": 0.7,
      "how": "Use db.adminCommand({dropIndexes: 'admin.system.views', index: 'my_index_name'}) as a superuser, but only if absolutely necessary and after backing up the collection.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Disable the system collection's read-only flag temporarily by restarting mongod with --setParameter 'systemCollectionsReadOnly=false' (MongoDB 6.0+), then drop the index, then re-enable.",
      "success_rate": 0.75,
      "how": "Disable the system collection's read-only flag temporarily by restarting mongod with --setParameter 'systemCollectionsReadOnly=false' (MongoDB 6.0+), then drop the index, then re-enable.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Use db.adminCommand({dropIndexes: 'admin.system.views', index: 'my_index_name'}) as a superuser, but only if absolutely necessary and after backing up the collection.",
    "Disable the system collection's read-only flag temporarily by restarting mongod with --setParameter 'systemCollectionsReadOnly=false' (MongoDB 6.0+), then drop the index, then re-enable."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.mongodb.com/docs/manual/reference/command/dropIndexes/#restrictions",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.72,
  "resolvable": "partial",
  "first_seen": "2023-08-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}