# MongoServerError: balancer failed to move chunk: chunk { ns: "test.users", min: { _id: 1 }, max: { _id: 100 } } could not be moved

- **ID:** `mongodb/balancer-failed-to-move-chunk`
- **Domain:** mongodb
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 78%

## Root Cause

The balancer could not move a chunk because the target shard had insufficient storage or the chunk exceeded the maximum chunk size.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| mongodb-5.0 | active | — | — |
| mongodb-6.0 | active | — | — |
| mongodb-7.0 | active | — | — |

## Workarounds

1. **Check target shard disk usage with db.adminCommand({ listShards: 1 }) and add more shards or free up space on the target.** (80% success)
   ```
   Check target shard disk usage with db.adminCommand({ listShards: 1 }) and add more shards or free up space on the target.
   ```
2. **Reduce chunk size temporarily via mongos config: use sh.enableAutoSplit() and sh.setBalancerState(true) with smaller chunkSize (e.g., 64MB) to split large chunks before migration.** (75% success)
   ```
   Reduce chunk size temporarily via mongos config: use sh.enableAutoSplit() and sh.setBalancerState(true) with smaller chunkSize (e.g., 64MB) to split large chunks before migration.
   ```
3. **Manually move the chunk using sh.moveChunk() with a specific shard key range to force migration during low traffic.** (70% success)
   ```
   Manually move the chunk using sh.moveChunk() with a specific shard key range to force migration during low traffic.
   ```

## Dead Ends

- **** — Increasing chunkSize to a very large value can cause uneven data distribution and balancer inefficiency. (50% fail)
- **** — Disabling the balancer entirely stops automatic data redistribution, leading to uneven shard loads. (50% fail)
- **** — Manually splitting chunks without considering data distribution can create many small chunks that strain the balancer. (50% fail)
