Kafka Error POSITION_OUT_OF_RANGE
Error code 99 · Non-retriable Admin
Requested position is not greater than or equal to zero, and less than the size of the snapshot.
Common Causes
- FetchSnapshot request specified a byte position that is beyond the actual size of the snapshot file on the leader
- Client-side snapshot fetch logic has a bug where it tracks an incorrect position offset after a retry or reconnect
- The snapshot was partially written or corrupted and its reported size does not match the actual file content
Solutions
- Restart the affected broker/controller to reset its snapshot fetch state and reinitiate a clean snapshot transfer from position 0
- Verify snapshot file integrity on the leader: compare file size on disk with the size reported in the snapshot header
- If snapshot corruption is suspected, trigger a new snapshot on the leader by restarting it or waiting for the next automatic snapshot generation
Diagnostic Commands
# List KRaft snapshot files on disk
ls -lh /var/kafka/data/__cluster_metadata-0/*.snapshot 2>/dev/null | head -10
# Look for snapshot errors in controller logs
grep 'PositionOutOfRange\|snapshot.*position\|FetchSnapshot' /var/log/kafka/controller.log | tail -20Related APIs
This error can be returned by: FetchSnapshot
Debugging Kafka errors? Conduktor Console gives you real-time visibility into your cluster. Explore all errors in the Error Decoder.