Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issues while connecting topics (SASL_SSL) to Kcache(4.0.3) #238

Open
bharathr9889 opened this issue May 10, 2022 · 3 comments
Open

issues while connecting topics (SASL_SSL) to Kcache(4.0.3) #238

bharathr9889 opened this issue May 10, 2022 · 3 comments

Comments

@bharathr9889
Copy link

hi @rayokota
I have started using 4.0.3 which has the parameter to provide jaas config.

However there is a issue in that if I use a topic that is already created :
props.setProperty(KafkaCacheConfig.KAFKACACHE_TOPIC_CONFIG, "<Existing_topic>");
We get below error :
io.kcache.exceptions.CacheInitializationException: Failed trying to create or validate topic <Existing_topic>

......

Caused by: java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.TopicAuthorizationException: Authorization failed.
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2022)
at org.apache.kafka.common.internals.KafkaFutureImpl.get(KafkaFutureImpl.java:180)
at io.kcache.KafkaCache.createTopic(KafkaCache.java:396)
at io.kcache.KafkaCache.createOrVerifyTopic(KafkaCache.java:350)

Note :
The calling method's class, io.kcache.KafkaCache, was loaded from the following location:

jar:file:/Users/breddy3/.m2/repository/io/kcache/kcache/4.0.3/kcache-4.0.3.jar!/io/kcache/KafkaCache.class
The called method's class, org.apache.kafka.clients.admin.DescribeTopicsResult, is available from the following locations:

jar:file:/Users/breddy3/.m2/repository/org/apache/kafka/kafka-clients/3.0.1/kafka-clients-3.0.1.jar!/org/apache/kafka/clients/admin/DescribeTopicsResult.class
The called method's class hierarchy was loaded from the following locations:

org.apache.kafka.clients.admin.DescribeTopicsResult: file:/Users/breddy3/.m2/repository/org/apache/kafka/kafka-clients/3.0.1/kafka-clients-3.0.1.jar
If we use a topic that is non Existing :
props.setProperty(KafkaCacheConfig.KAFKACACHE_TOPIC_CONFIG, "");
io.kcache.exceptions.CacheInitializationException: Failed trying to create or validate topic
at io.kcache.KafkaCache.createOrVerifyTopic(KafkaCache.java:360)
at io.kcache.KafkaCache.init(KafkaCache.java:276)

@bharathr9889
Copy link
Author

@rayokota

@HunterSherms
Copy link
Contributor

@bharathr9889 I'm not sure if this is helpful to you, but if you know your topic will already exist you can skip topic creation and validation with the config KafkaCacheConfig.KAFKACACHE_TOPIC_SKIP_VALIDATION_CONFIG

@Schm1tz1
Copy link

Hi @bharathr9889,
the internal topic does not exist so it starts an admin client to create that topic. It looks like you don't have permissions to create that topic - possibly a missing ACL / RBAC rolebinding. Either you need to give permissions to create that topic to the user running KCache or create it manually.
@HunterSherms - this will at least skip the topic creation issue but as a consequence, it will run into a retryable exception indicating that the topic does not exists. If auto-creation is activated on broker-side it will create the topic and work, if it is not activated, the consumer will fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants