Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-14738

Topic disappears from kafka_topic.sh --list after modifying it with kafka_acl.sh

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Bug
    • 3.2.3
    • None
    • core
    • None

    Description

      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)

      Attachments

        Activity

          People

            Unassigned Unassigned
            lgabo Gabriel Lukacs
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: