{
  "id": "huggingface/dataset-sharding-index-out-of-range",
  "signature": "IndexError: list index out of range while processing shard 4 of dataset 'my_dataset'",
  "signature_zh": "IndexError: 处理数据集 'my_dataset' 的分片 4 时列表索引超出范围",
  "regex": "IndexError: list index out of range while processing shard \\d+ of dataset '.*'",
  "domain": "huggingface",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "Dataset shard file is corrupted or incomplete, causing fewer examples than expected when splitting into shards.",
  "root_cause_type": "generic",
  "root_cause_zh": "数据集分片文件损坏或不完整，导致分片时实际样本数少于预期。",
  "versions": [
    {
      "version": "huggingface/datasets 2.18.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "huggingface/datasets 2.19.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "huggingface/datasets 2.20.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Increase shard count to reduce per-shard size",
      "why_fails": "The error is due to a corrupted shard file, not shard size. Changing shard count doesn't fix the underlying data corruption.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "Re-download the entire dataset without checking shard integrity",
      "why_fails": "If the cache is corrupt, simply re-downloading without clearing the cache may reuse the same corrupted file.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Clear the dataset cache and re-download: `import datasets; datasets.load_dataset('my_dataset', cache_dir='/tmp/fresh_cache')`",
      "success_rate": 0.85,
      "how": "Clear the dataset cache and re-download: `import datasets; datasets.load_dataset('my_dataset', cache_dir='/tmp/fresh_cache')`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Manually verify shard files: `ls ~/.cache/huggingface/datasets/my_dataset/*.arrow` and remove any zero-byte files before re-loading.",
      "success_rate": 0.8,
      "how": "Manually verify shard files: `ls ~/.cache/huggingface/datasets/my_dataset/*.arrow` and remove any zero-byte files before re-loading.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Clear the dataset cache and re-download: `import datasets; datasets.load_dataset('my_dataset', cache_dir='/tmp/fresh_cache')`",
    "Manually verify shard files: `ls ~/.cache/huggingface/datasets/my_dataset/*.arrow` and remove any zero-byte files before re-loading."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://huggingface.co/docs/datasets/en/loading#sharding",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.88,
  "resolvable": "true",
  "first_seen": "2024-03-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}