org.apache.kafka.common.errors.GroupAuthorizationException: Not authorized to access group: XXX

The other day my team ran into below issue. I did debugging to help them resolve this. The error was straight forward, issue with Authorization ie ACL (Access Control List) are not correctly setup.

[shri@xxxxx config]# /opt/kafka_2.11-0.10.1.1/bin/kafka-console-consumer.sh –bootstrap-server xxxxx:9093 —topic topic1 –consumer.config /opt/kafka_2.11-0.10.1.1/config/consumer-ssl.properties –from-beginning
[2017-06-08 23:06:15,290] WARN Error while fetching metadata with correlation id 1 : {topic1=UNKNOWN_TOPIC_OR_PARTITION} (org.apache.kafka.clients.NetworkClient)
[2017-06-08 23:06:15,292] ERROR Unknown error when running consumer: (kafka.tools.ConsoleConsumer$)
org.apache.kafka.common.errors.GroupAuthorizationException: Not authorized to access group: group1

The way to debug issue,

1. List the ACL for the topic ie topic1 and consumer group ie group1

Current ACLs for resource `Topic:topic1`:
User:CN=consumer.shri.com,OU=IT,O=XXX,L=Austin,ST=TX,C=US has Allow permission for operations: Describe from hosts: *
User:CN=producer.shri.com,OU=IT,O=XXX,L=Austin,ST=TX,C=US has Allow permission for operations: Describe from hosts: *
User:CN=consumer.shri.com,OU=IT,O=XXX,L=Austin,ST=TX,C=US has Allow permission for operations: Read from hosts: *
User:CN=producer.shri.com,OU=IT,O=XXX,L=Austin,ST=TX,C=US has Allow permission for operations: Write from hosts: *

Current ACLs for resource `Group:group1`:
User:CN=consumer.shri.com,OU=IT,O=XXX,L=Dallas,ST=TX,C=US has Allow permission for operations: Read from hosts: *

2. List the certificate (keystore) being used by the consumer. As you can see there is minor difference in ACL setup for topic and group and cert being used by the consumer. ACL had location as Austin, while cert had location as Atlanta. We change cert to match what was in the ACL, that resolve the error.

The JKS subject is
[spatel@xxxxx config]# keytool -v -list -keystore test.jks
Certificate[1]:
Owner: CN=consumer.shri.com, OU=IT, O=XXX Inc., L=Atlanta, ST=TX, C=US

So its simple setup issue, make sure all the configuration and setup line up correctly.

Advertisements

Yikes! Ask timed out on [ActorSelection[Anchor(akka://kafka-manager-system/), Path(/user/kafka-manager)]] after [5000 ms]

I am looking at Yahoo Kafka manager as admin console for my kafka cluster. I followed the instruction on the github repo to build the artificat. (But skipped the running instruction section.)

My local environment is windows.

shrik@DESKTOP-GLB3R08 C:\kafka-manager-1.3.0.7\bin
> kafka-manager.bat

i got the kafka manager ui at http://localhost:9000, but i tried to add kafka cluster i got the below error on the screen

Yikes! Ask timed out on [ActorSelection[Anchor(akka://kafka-manager-system/), Path(/user/kafka-manager)]] after [5000 ms]

and following error in log file

[warn] o.a.c.ConnectionState – Connection attempt unsuccessful after 61188 (greater than max timeout of 60000). Resetting connection and trying again with a new connection.
[info] o.a.z.ZooKeeper – Initiating client connection, connectString=kafka-manager-zookeeper:2181 sessionTimeout=60000 watcher=org.apache.curator.ConnectionState@628bc91a
[error] a.a.OneForOneStrategy – exception during creation
akka.actor.ActorInitializationException: exception during creation
at akka.actor.ActorInitializationException$.apply(Actor.scala:166) ~[com.typesafe.akka.akka-actor_2.11-2.3.14.jar:na]
at akka.actor.ActorCell.create(ActorCell.scala:596) ~[com.typesafe.akka.akka-actor_2.11-2.3.14.jar:na]
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:456) ~[com.typesafe.akka.akka-actor_2.11-2.3.14.jar:na]

The issue was i did not have zookeeper host configured correctly.

There 2 ways you can set this either by command line

kafka-manager -Dkafka-manager.zkhosts=”localhost:2181″ -Dhttp.port=9999

or

via application.conf property file.
kafka-manager.zkhosts=”kafka-manager-zookeeper:2181″ # this is default value, change it to point to zk instance.

(-Dhttp.port parameter is port number for Kafka manager application, so it will run on 9999, instead default port of 9000).