[ https://issues.apache.org/jira/browse/KAFKA-12701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17326909#comment-17326909 ]
Justine Olshan edited comment on KAFKA-12701 at 4/22/21, 12:09 AM: ------------------------------------------------------------------- [~dengziming] I can work on the part where we return an error for earlier versions if you haven't started on that already. was (Author: jolshan): [~dengziming] I can work on the 2.8 version where we return an error if you haven't started on that already. > NPE in MetadataRequest when using topic IDs > ------------------------------------------- > > Key: KAFKA-12701 > URL: https://issues.apache.org/jira/browse/KAFKA-12701 > Project: Kafka > Issue Type: Bug > Affects Versions: 2.8.0 > Reporter: Travis Bischel > Assignee: dengziming > Priority: Major > > Authorized result checking relies on topic name to not be null, which, when > using topic IDs, it is. > Unlike the logic in handleDeleteTopicsRequest, hanelMetadataRequest does not > check zk for the names corresponding to topic IDs if topic IDs are present. > {noformat} > [2021-04-21 05:53:01,463] ERROR [KafkaApi-1] Error when handling request: > clientId=kgo, correlationId=1, api=METADATA, version=11, > body=MetadataRequestData(topics=[MetadataRequestTopic(topicId=LmqOoFOASnqQp_4-oJgeKA, > name=null)], allowAutoTopicCreation=false, > includeClusterAuthorizedOperations=false, > includeTopicAuthorizedOperations=false) (kafka.server.RequestHandlerHelper) > java.lang.NullPointerException: name > at java.base/java.util.Objects.requireNonNull(Unknown Source) > at > org.apache.kafka.common.resource.ResourcePattern.<init>(ResourcePattern.java:50) > at > kafka.server.AuthHelper.$anonfun$filterByAuthorized$3(AuthHelper.scala:121) > at scala.collection.Iterator$$anon$9.next(Iterator.scala:575) > at scala.collection.mutable.Growable.addAll(Growable.scala:62) > at scala.collection.mutable.Growable.addAll$(Growable.scala:57) > at scala.collection.mutable.ArrayBuffer.addAll(ArrayBuffer.scala:142) > at scala.collection.mutable.ArrayBuffer.addAll(ArrayBuffer.scala:42) > at scala.collection.mutable.ArrayBuffer$.from(ArrayBuffer.scala:258) > at scala.collection.mutable.ArrayBuffer$.from(ArrayBuffer.scala:247) > at scala.collection.SeqFactory$Delegate.from(Factory.scala:306) > at scala.collection.IterableOnceOps.toBuffer(IterableOnce.scala:1270) > at scala.collection.IterableOnceOps.toBuffer$(IterableOnce.scala:1270) > at scala.collection.AbstractIterator.toBuffer(Iterator.scala:1288) > at kafka.server.AuthHelper.filterByAuthorized(AuthHelper.scala:120) > at > kafka.server.KafkaApis.handleTopicMetadataRequest(KafkaApis.scala:1146) > at kafka.server.KafkaApis.handle(KafkaApis.scala:170) > at kafka.server.KafkaRequestHandler.run(KafkaRequestHandler.scala:74) > at java.base/java.lang.Thread.run(Unknown Source) > [2021-04-21 05:53:01,464] ERROR [Kafka Request Handler 1 on Broker 1], > Exception when handling request (kafka.server.KafkaRequestHandler) > java.lang.NullPointerException > at > org.apache.kafka.common.message.MetadataResponseData$MetadataResponseTopic.addSize(MetadataResponseData.java:1247) > at > org.apache.kafka.common.message.MetadataResponseData.addSize(MetadataResponseData.java:417) > at > org.apache.kafka.common.protocol.SendBuilder.buildSend(SendBuilder.java:218) > at > org.apache.kafka.common.protocol.SendBuilder.buildResponseSend(SendBuilder.java:200) > at > org.apache.kafka.common.requests.AbstractResponse.toSend(AbstractResponse.java:43) > at > org.apache.kafka.common.requests.RequestContext.buildResponseSend(RequestContext.java:111) > at > kafka.network.RequestChannel$Request.buildResponseSend(RequestChannel.scala:132) > at > kafka.server.RequestHandlerHelper.sendResponse(RequestHandlerHelper.scala:185) > at > kafka.server.RequestHandlerHelper.sendErrorOrCloseConnection(RequestHandlerHelper.scala:155) > at > kafka.server.RequestHandlerHelper.sendErrorResponseMaybeThrottle(RequestHandlerHelper.scala:109) > at > kafka.server.RequestHandlerHelper.handleError(RequestHandlerHelper.scala:79) > at kafka.server.KafkaApis.handle(KafkaApis.scala:229) > at kafka.server.KafkaRequestHandler.run(KafkaRequestHandler.scala:74) > at java.base/java.lang.Thread.run(Unknown Source) > {noformat} -- This message was sent by Atlassian Jira (v8.3.4#803005)