You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Yousef Amar (JIRA)" <ji...@apache.org> on 2017/06/23 09:34:02 UTC

[jira] [Created] (KAFKA-5506) bin/kafka-consumer-groups.sh failing to query offsets

Yousef Amar created KAFKA-5506:
----------------------------------

             Summary: bin/kafka-consumer-groups.sh failing to query offsets
                 Key: KAFKA-5506
                 URL: https://issues.apache.org/jira/browse/KAFKA-5506
             Project: Kafka
          Issue Type: Bug
          Components: consumer
         Environment: Linux slfd06 4.4.0-78-generic #99~14.04.2-Ubuntu SMP Thu Apr 27 18:49:46 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
            Reporter: Yousef Amar


When I found that {{bin/kafka-consumer-offset-checker.sh}} was deprecated and didn't work, I checked the docs and ran the following instead (using new consumer, and coordinator vs zookeeper):

{code:java}
bin/kafka-consumer-groups.sh --new-consumer --bootstrap-server localhost:9092 --describe --group test
{code}

I kept getting a NullPointerException though (line numbers are a bit off because of debug code):

{code:java}
java.lang.NullPointerException
        at org.apache.kafka.common.utils.Utils.join(Utils.java:399)
        at org.apache.kafka.common.requests.OffsetFetchRequest$Builder.toString(OffsetFetchRequest.java:77)
        at java.lang.String.valueOf(String.java:2994)
        at java.lang.StringBuilder.append(StringBuilder.java:131)
        at org.apache.kafka.clients.ClientRequest.toString(ClientRequest.java:65)
        at org.apache.kafka.clients.NetworkClient.doSend(NetworkClient.java:375)
        at org.apache.kafka.clients.NetworkClient.send(NetworkClient.java:332)
        at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.trySend(ConsumerNetworkClient.java:409)
        at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:252)
        at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:208)
        at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:199)
        at kafka.admin.AdminClient$$anon$1.run(AdminClient.scala:61)
        at java.lang.Thread.run(Thread.java:748)
Error: Executing consumer group command failed due to The server experienced an unexpected error when processing the request
{code}

I tracked this down to the following. The request builder that is instantiated [here|https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/admin/AdminClient.scala#L198] has its {{partitions}} set to {{ALL_TOPIC_PARTITIONS}} which is null (v2 or newer to request all topic partitions). Later, [when sending the request|https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/NetworkClient.java#L375], it's converted to a string. But {{partitions}} above can only be null when built that way, so [this|https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/requests/OffsetFetchRequest.java#L76] throws the exception.

I'm quite new to Kafka, so I'm still not entirely sure if I'm doing something wrong or if this is indeed a bug. As such, any pointers or advice would be much appreciated.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)