# OSError: [Errno 84] Too many links while accessing dataset cache

- **ID:** `huggingface/dataset-cache-corruption`
- **Domain:** huggingface
- **Category:** system_error
- **Error Code:** `84`
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

The Hugging Face datasets library creates many symlinks in the cache directory, exceeding the filesystem's maximum link count (often 32000 on ext4).

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| datasets>=2.10.0 | active | — | — |
| transformers>=4.25.0 | active | — | — |

## Workarounds

1. **Clear the entire datasets cache using datasets.set_caching_enabled(False) or remove the cache directory.** (90% success)
   ```
   Clear the entire datasets cache using datasets.set_caching_enabled(False) or remove the cache directory.
   ```
2. **Set HF_DATASETS_CACHE to a filesystem with higher link limits (e.g., tmpfs or XFS).** (85% success)
   ```
   Set HF_DATASETS_CACHE to a filesystem with higher link limits (e.g., tmpfs or XFS).
   ```
3. **Use streaming mode to avoid caching entirely.** (75% success)
   ```
   Use streaming mode to avoid caching entirely.
   ```

## Dead Ends

- **** — Individual file deletion does not reduce the symlink count sufficiently; entire cache tree must be removed. (80% fail)
- **** — Reinstallation does not affect the existing cache directory structure. (95% fail)
