Kafka TOPIC_AUTHORIZATION_FAILED: causes and fix
Codemia Knowledge Hub ·
TOPIC_AUTHORIZATION_FAILED means the Kafka client's principal does not have the ACL permission required for the operation it attempted on a topic. Find out which principal the client is using, check the topic's ACLs, and grant the missing permission with kafka-acls.sh.
When the error appears
- Producing: the client sends to a topic without "write" permission.
- Consuming: the client reads from a topic without "read" permission.
- Managing topics: the client creates, deletes or alters a topic without the matching "create", "delete" or "alter" permission.
The broker checks every request with an Authorizer class configured in its server settings, which compares the request against Access Control Lists (ACLs) set by administrators.
How Kafka ACLs work
ACLs define what a user or group can do on topics, consumer groups or the cluster. This command grants a user read access to a topic:
admin.properties holds the admin client's security settings. The broker's authorizer is set with authorizer.class.name in server.properties: org.apache.kafka.metadata.authorizer.StandardAuthorizer on KRaft clusters, or kafka.security.authorizer.AclAuthorizer, which stores ACLs in ZooKeeper, on older ZooKeeper-based clusters.
Fixing the error
- Confirm the identity: find out which user or principal is performing the operation.
- Check the ACLs for the topic and make sure the needed permission is granted for that action.
- Read the Kafka logs: they record authorization decisions and show which permission was denied.
- Update the ACLs to add any missing permission.
Producer and consumer cases
- Producer gets
TOPIC_AUTHORIZATION_FAILED: give the producer's principal write permission on the topic. - Consumer gets
TOPIC_AUTHORIZATION_FAILED: give the consumer's principal read permission on the topic.
Permissions by operation
| Component | Required Permission | Common Causes | Resolution Steps |
| Producing Messages | Write | ACL does not include write access | Add write permission to the ACL |
| Consuming Messages | Read | No read access in ACL | Grant read access through ACL update |
| Managing Topics | Create, Delete, Alter | Insufficient management permissions | Adjust ACLs to include necessary permissions |
Review permissions regularly and adjust them as clients change, so authorized clients keep working and unauthorized ones stay out.
Related reading
- kafka topic configuration using properties file
- Kafka topic creation best-practice
- Kafka topic creation Timed out waiting for a node assignment
- Kafka Topic creation upon specific broker
- kdevtmpfsi - how to find and delete that miner
- Keep TensorFlow Model Encrypted on Android
- Kafka topic is getting reappeared after 10 sec of deletion
- Kafka topic no longer exists after restart
System design interview problems on this topic
- Design a Distributed Messaging System: solution and walkthrough
- Design a Log Collection and Analysis System: solution and walkthrough
- Design an Ad Click Aggregation System: solution and walkthrough
- Design a Webhook Notification Service: solution and walkthrough

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseSystem Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.