[ https://issues.apache.org/jira/browse/KAFKA-10450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17188085#comment-17188085 ]
Jigar Naik commented on KAFKA-10450: ------------------------------------ Yes, same version for both. And also from kafka console consumer which ship with kafka gave the same error. i have found the issue. The port 9092 was being used by sonarqube H2 DB. after stopping sonarqube everything worked fine. surprisingly i was hoping to getting address already in use instead of this stack trace. and also the kafka_topic.sh worked fine without any issue. Changing the priority to minor as its no-more blocker. It would be better if proper error message is displayed instead of this stacktrace. It would have saved few hours for me:) thanks! > console-producer throws Uncaught error in kafka producer I/O thread: > (org.apache.kafka.clients.producer.internals.Sender) > java.lang.IllegalStateException: There are no in-flight requests for node -1 > ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: KAFKA-10450 > URL: https://issues.apache.org/jira/browse/KAFKA-10450 > Project: Kafka > Issue Type: Bug > Components: producer > Affects Versions: 2.6.0 > Environment: Kafka Version 2.6.0 > MacOS Version - macOS Catalina 10.15.6 (19G2021) > java version "11.0.8" 2020-07-14 LTS > Java(TM) SE Runtime Environment 18.9 (build 11.0.8+10-LTS) > Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.8+10-LTS, mixed mode) > Reporter: Jigar Naik > Priority: Critical > > Kafka-console-producer.sh gives below error on Mac > ERROR [Producer clientId=console-producer] Uncaught error in kafka producer > I/O thread: (org.apache.kafka.clients.producer.internals.Sender) > java.lang.IllegalStateException: There are no in-flight requests for node -1 > *Steps to re-produce the issue.* > Download Kafka from > [kafka_2.13-2.6.0.tgz|https://www.apache.org/dyn/closer.cgi?path=/kafka/2.6.0/kafka_2.13-2.6.0.tgz] > > Change data and log directory (Optional) > Create Topic Using below command > > {code:java} > ./kafka-topics.sh \ > --create \ > --zookeeper localhost:2181 \ > --replication-factor 1 \ > --partitions 1 \ > --topic my-topic{code} > > Start Kafka console producer using below command > > {code:java} > ./kafka-console-consumer.sh \ > --topic my-topic \ > --from-beginning \ > --bootstrap-server localhost:9092{code} > > Gives below output > > {code:java} > ./kafka-console-producer.sh \ > --topic my-topic \ > --bootstrap-server 127.0.0.1:9092 > >[2020-09-01 00:24:18,177] ERROR [Producer clientId=console-producer] > >Uncaught error in kafka producer I/O thread: > >(org.apache.kafka.clients.producer.internals.Sender) > java.nio.BufferUnderflowException > at java.base/java.nio.Buffer.nextGetIndex(Buffer.java:650) > at java.base/java.nio.HeapByteBuffer.getInt(HeapByteBuffer.java:391) > at > org.apache.kafka.common.protocol.ByteBufferAccessor.readInt(ByteBufferAccessor.java:43) > at > org.apache.kafka.common.message.ResponseHeaderData.read(ResponseHeaderData.java:102) > at > org.apache.kafka.common.message.ResponseHeaderData.<init>(ResponseHeaderData.java:70) > at > org.apache.kafka.common.requests.ResponseHeader.parse(ResponseHeader.java:66) > at > org.apache.kafka.clients.NetworkClient.parseStructMaybeUpdateThrottleTimeMetrics(NetworkClient.java:717) > at > org.apache.kafka.clients.NetworkClient.handleCompletedReceives(NetworkClient.java:834) > at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:553) > at org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:325) > at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:240) > at java.base/java.lang.Thread.run(Thread.java:834) > [2020-09-01 00:24:18,179] ERROR [Producer clientId=console-producer] Uncaught > error in kafka producer I/O thread: > (org.apache.kafka.clients.producer.internals.Sender) > java.lang.IllegalStateException: There are no in-flight requests for node -1 > at > org.apache.kafka.clients.InFlightRequests.requestQueue(InFlightRequests.java:62) > at > org.apache.kafka.clients.InFlightRequests.completeNext(InFlightRequests.java:70) > at > org.apache.kafka.clients.NetworkClient.handleCompletedReceives(NetworkClient.java:833) > at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:553) > at org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:325) > at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:240) > at java.base/java.lang.Thread.run(Thread.java:834) > [2020-09-01 00:24:18,682] WARN [Producer clientId=console-producer] Bootstrap > broker 127.0.0.1:9092 (id: -1 rack: null) disconnected > (org.apache.kafka.clients.NetworkClient) > {code} > > > The same steps works fine with Kafka version 2.0.0 on Mac. > The same steps works fine with Kafka version 2.6.0 on Windows. > > -- This message was sent by Atlassian Jira (v8.3.4#803005)