[
https://issues.apache.org/jira/browse/KAFKA-8053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16785817#comment-16785817
]
ASF GitHub Bot commented on KAFKA-8053:
---------------------------------------
scholzj commented on pull request #6381: KAFKA-8053: Provide better error in
kafka-topics.sh message when topi…
URL: https://github.com/apache/kafka/pull/6381
…c doesn't exist
This PR tries to address
[KAFKA-8053](https://issues.apache.org/jira/browse/KAFKA-8053). It passes the
option with which the user originally called the `kafka-topics.sh` tool to the
`ensureTopicExists` method to try to produce better error message. It also
handles the case when the user doesn't specify any topics at all (which is for
example allowed for `--describe`).
If you prefer to address this differently, let me know and I can update the
PR.
### Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> kafka-topics.sh gives confusing error message when the topic doesn't exist
> --------------------------------------------------------------------------
>
> Key: KAFKA-8053
> URL: https://issues.apache.org/jira/browse/KAFKA-8053
> Project: Kafka
> Issue Type: Bug
> Reporter: Jakub Scholz
> Priority: Minor
>
> The kafka-topics.sh utility gives a confusing message when the topic it is
> called with doesn't exist or when no topics exist at all:
> {code}
> bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic xxx
> Error while executing topic command : Topics in [] does not exist
> [2019-03-06 13:26:33,982] ERROR java.lang.IllegalArgumentException: Topics in
> [] does not exist
> at
> kafka.admin.TopicCommand$.kafka$admin$TopicCommand$$ensureTopicExists(TopicCommand.scala:416)
> at
> kafka.admin.TopicCommand$ZookeeperTopicService.describeTopic(TopicCommand.scala:332)
> at kafka.admin.TopicCommand$.main(TopicCommand.scala:66)
> at kafka.admin.TopicCommand.main(TopicCommand.scala)
> (kafka.admin.TopicCommand$)
> {code}
> It tries to list the topics, but because list of topics is always empty, it
> always prints just `[]`. The error message should be more useful and instead
> list the topic passed by the user as the parameter or not try to list
> anything at all.
>
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)