You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Soumyajit Sahu (Jira)" <ji...@apache.org> on 2023/02/21 16:50:00 UTC
[jira] [Commented] (KAFKA-14738) Topic disappears from kafka_topic.sh --list after modifying it with kafka_acl.sh
[ https://issues.apache.org/jira/browse/KAFKA-14738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17691708#comment-17691708 ]
Soumyajit Sahu commented on KAFKA-14738:
----------------------------------------
This is not a bug. You are listing your topics as ANONYMOUS user and your topic now has an acl for User:test.
If you try to list the topics as user test, it should list it for you. Try the --command.config parameter to pass a jaas config.
> Topic disappears from kafka_topic.sh --list after modifying it with kafka_acl.sh
> --------------------------------------------------------------------------------
>
> Key: KAFKA-14738
> URL: https://issues.apache.org/jira/browse/KAFKA-14738
> Project: Kafka
> Issue Type: Bug
> Components: core
> Affects Versions: 3.2.3
> Reporter: Gabriel Lukacs
> Priority: Major
>
> Topic is not listed via kafka-topics.sh --list after modifying it with kafka-acls.sh (-add --allow-principal User:CN=test --operation Read):
> $ /opt/kafka/bin/kafka-topics.sh --create --bootstrap-server kafka:9092 --topic test2 --replication-factor 1 --partitions 50
> Created topic test2.
> $ /opt/kafka/bin/kafka-topics.sh --list --bootstrap-server kafka:9092 --topic test2
> test2
> $ /opt/kafka/bin/kafka-acls.sh --bootstrap-server kafka:9092 --topic test2 --add --allow-principal User:CN=test --operation Read
> Adding ACLs for resource `ResourcePattern(resourceType=TOPIC, name=test2, patternType=LITERAL)`:
> (principal=User:CN=test, host=*, operation=READ, permissionType=ALLOW)
> Current ACLs for resource `ResourcePattern(resourceType=TOPIC, name=test2, patternType=LITERAL)`:
> (principal=User:CN=test, host=*, operation=READ, permissionType=ALLOW)
> $ /opt/kafka/bin/kafka-topics.sh --list --bootstrap-server kafka:9092 --topic test2
> $ /opt/kafka/bin/kafka-topics.sh --create --bootstrap-server kafka:9092 --topic test2
> Error while executing topic command : Topic 'test2' already exists.
> [2023-02-21 16:37:39,185] ERROR org.apache.kafka.common.errors.TopicExistsException: Topic 'test2' already exists.
> (kafka.admin.TopicCommand$)
> $ /opt/kafka/bin/kafka-topics.sh --delete --bootstrap-server kafka:9092 --topic test2
> Error while executing topic command : Topic 'test2' does not exist as expected
> [2023-02-21 16:37:49,485] ERROR java.lang.IllegalArgumentException: Topic 'test2' does not exist as expected
> at kafka.admin.TopicCommand$.kafka$admin$TopicCommand$$ensureTopicExists(TopicCommand.scala:401)
> at kafka.admin.TopicCommand$TopicService.deleteTopic(TopicCommand.scala:361)
> at kafka.admin.TopicCommand$.main(TopicCommand.scala:63)
> at kafka.admin.TopicCommand.main(TopicCommand.scala)
> (kafka.admin.TopicCommand$)
> $ /opt/kafka/bin/kafka-topics.sh --version
> 3.2.3 (Commit:50029d3ed8ba576f)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)