aiokafka icon indicating copy to clipboard operation
aiokafka copied to clipboard

NodeNotReadyError prevents publisher from sending

Open eirikur-grid opened this issue 4 years ago • 3 comments

Describe the bug We received an alert from our error monitoring system. There are 3 log lines from aiokafka loggers at the time of the incident:

2020-07-04T18:06:27.135 - Unable connect to node with id 1:
2020-07-04T18:06:27.142 - Got error produce response: NodeNotReadyError: Attempt to send a request to node which is not ready (node id 1).
2020-07-04T18:06:27.218 - Authenticated as *** via PLAIN

The stacktrace points to:

...
File "grid/systems/kafka.py", line 70, in publish
    await self.producer.send_and_wait(
  File "aiokafka/producer/producer.py", line 452, in send_and_wait
    return (await future)

Expected behaviour Message sending is retried

Environment (please complete the following information):

  • aiokafka version: 0.6.0
  • kafka-python version: 2.0.1
  • Other information: We are using Confluent Cloud

eirikur-grid avatar Jul 06 '20 17:07 eirikur-grid

any progress on this? I have same issue with 0.6.0

OpakAlex avatar Dec 16 '20 14:12 OpakAlex

I've encountered the same issue, with the same version.

aiokafka==0.6.0
kafka-python==2.0.2

bt-wil avatar Jun 18 '21 19:06 bt-wil

We're having the same problem - aiokafka==0.10.0, connected to confluent kafka, occasionally fails with:

Unable connect to node with id 5: 
Got error produce response: NodeNotReadyError: Attempt to send a request to node which is not ready (node id 5).

and then getting error:

Traceback (most recent call last):
  File "**/infrastructure/kafka/event_publisher.py", line 24, in publish
    future = await self.kafka_producer.send(topic, key=key, value=event)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiokafka/producer/producer.py", line 465, in send
    fut = await self._message_accumulator.add_message(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiokafka/producer/message_accumulator.py", line 343, in add_message
    raise KafkaTimeoutError()
aiokafka.errors.KafkaTimeoutError: KafkaTimeoutError
```

kamilglod avatar Mar 04 '24 09:03 kamilglod