Kafka Error UNKNOWN_CONTROLLER_ID
Error code 116 · Non-retriable KRaft
This controller ID is not known.
Common Causes
- Client or broker sent a request referencing a controller ID that is no longer the active controller — the active controller changed (failover) between when the client discovered the controller and when the request arrived.
- Stale metadata in the client: the client cached the controller ID from a previous `Metadata` response, but a controller election has since occurred and a new controller is now active.
- In a KRaft cluster, a follower controller received a request intended for the active controller, and the follower doesn't recognize the controller ID in the request.
Solutions
- Force the client or admin tool to refresh its metadata by re-fetching from the bootstrap servers. In AdminClient, metadata is refreshed automatically on error — ensure `metadata.max.age.ms` is not set too high (default 5 minutes).
- Check controller health with `kafka-metadata-quorum.sh --bootstrap-server localhost:9092 describe --status` to confirm which broker is the active controller and whether the quorum is stable. If the controller is unstable, investigate election logs.
- Reduce `metadata.max.age.ms` on clients in environments with frequent controller failovers, so stale controller IDs are invalidated faster.
Diagnostic Commands
# Check KRaft metadata quorum status
kafka-metadata-quorum.sh --bootstrap-server localhost:9092 --command-config admin.properties describe --status
# Look for related errors in broker logs
grep 'UNKNOWN_CONTROLLER_ID\|controller election\|became active controller' /var/log/kafka/server.log | tail -50
Debugging Kafka errors? Conduktor Console gives you real-time visibility into your cluster. Explore all errors in the Error Decoder.