Kafka Error FENCED_INSTANCE_ID
Error code 82 · Non-retriable Consumer
The broker rejected this static consumer since another consumer with the same group.instance.id has registered with a different member.id.
Common Causes
- Two consumer instances were started with the same group.instance.id (static membership), causing the broker to fence the older one when the newer one joins
- A consumer crashed and restarted with the same group.instance.id before the session timeout expired, and a duplicate was already registered
- Kubernetes or container orchestration created a duplicate pod with the same static instance ID due to a misconfigured StatefulSet or deployment
Solutions
- Ensure each consumer instance has a unique, stable group.instance.id — typically derived from the pod name or hostname in Kubernetes (e.g., MY_APP_POD_NAME env var)
- After a crash, wait for the member session timeout to expire before restarting with the same instance ID, or shut the old member down cleanly so it sends LeaveGroup before the replacement starts
- In Kubernetes, use the StatefulSet pod ordinal as part of the instance ID to guarantee uniqueness across restarts
Diagnostic Commands
# Check group members for the instance ID
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group <group-id> | grep <instance-id>
# Search all groups for a specific instance ID
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --list | xargs -I{} kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group {} 2>/dev/null | grep <instance-id>
Debugging Kafka errors? Conduktor Console gives you real-time visibility into your cluster. Explore all errors in the Error Decoder.