Kafka Error DUPLICATE_SEQUENCE_NUMBER
Error code 46 · Non-retriable Producer
The broker received a duplicate sequence number.
Common Causes
- Producer retried a batch that was already successfully written to the broker (network ACK lost, producer assumed failure and retried)
- Producer was fenced and a new instance re-used the same producer ID with the same sequence numbers before the old epoch expired
- Connection reset between broker and producer after write succeeded but before the response was received, triggering an automatic retry
Solutions
- This is generally safe with idempotent producers — the broker deduplicates and the client continues normally; treat as a warning, not an error
- Ensure enable.idempotence=true so the client handles this transparently; do not manually retry on this error
- Monitor duplicate sequence rates in JMX; elevated rates indicate network instability between producer and broker that should be investigated
Diagnostic Commands
# Look for sequence number errors in logs
grep 'DUPLICATE_SEQUENCE\|DuplicateSequence\|duplicate sequence' /var/log/kafka/server.log | tail -20
# Check producer-side duplicates or retries in application logs
grep 'DuplicateSequence\|duplicate sequence\|retrying batch' /var/log/kafka/*.log /var/log/app/*.log 2>/dev/null | tail -20Related APIs
This error can be returned by: Produce
Debugging Kafka errors? Conduktor Console gives you real-time visibility into your cluster. Explore all errors in the Error Decoder.