Kafka Error DUPLICATE_VOTER
Error code 126 · Non-retriable KRaft
The voter is already part of the set of voters.
Common Causes
- An `AddRaftVoter` request was sent to add a controller to the KRaft quorum, but the specified voter ID is already present in the current voter set — typically caused by retrying an already-successful add operation.
- Automation or runbooks triggered a voter addition twice (idempotency not enforced at the orchestration layer), resulting in a duplicate registration attempt.
- After a controller restart, the operator incorrectly re-ran the voter registration command not realizing the previous attempt had succeeded and the controller is already part of the quorum.
Solutions
- Before running `AddRaftVoter`, always check the current voter set with `kafka-metadata-quorum.sh --bootstrap-server localhost:9092 describe --replication`. If the voter is already registered, no action is needed — the error can be safely ignored in idempotent workflows.
- Make voter addition scripts idempotent: check voter membership before attempting to add, or handle the `DUPLICATE_VOTER` error as a no-op success condition.
- If the voter was added incorrectly and needs to be replaced, use `RemoveRaftVoter` first to cleanly remove the existing entry before re-adding with corrected parameters.
Diagnostic Commands
# Check KRaft metadata quorum status
kafka-metadata-quorum.sh --bootstrap-server localhost:9092 --command-config admin.properties describe --replication
# Look for voter events in controller logs
grep 'DUPLICATE_VOTER\|AddRaftVoter\|voter set' /var/log/kafka/controller.log | tail -30Related APIs
This error can be returned by: AddRaftVoter
Debugging Kafka errors? Conduktor Console gives you real-time visibility into your cluster. Explore all errors in the Error Decoder.