kafka-python icon indicating copy to clipboard operation
kafka-python copied to clipboard

TypeError: 'NoneType' object is not iterable

Open avloss opened this issue 5 years ago • 2 comments

https://github.com/dpkp/kafka-python/blob/bd557dabd487cc44c11bf003600c82477ea5de11/kafka/producer/kafka.py#L711

Intermittently getting this issue - not sure what is going on - I'm intending for topics to be auto-created. So obviously they don't have partitions. Though it still manages to work overall somehow. Perhaps if I'm pushing one message, and the topic is being created, and doesn't yet have any partitions, then pushing second message to the same topic would produce this error. Very strange error, and I'm getting it a lot!

avloss avatar Aug 19 '20 01:08 avloss

Can you include example code and the full traceback? I realize the code works 99% of the time, and only intermittently throws the error and only with a new auto-created topic, but it'd still be helpful for stepping through what's happening.

jeffwidman avatar Sep 17 '20 20:09 jeffwidman

Hi, have you found any solution for this?

OlehDziuba avatar Sep 19 '24 09:09 OlehDziuba

This is probably caused by a race condition caused by a new metadata response between _wait_for_metadata and _partition.

dpkp avatar Mar 12 '25 19:03 dpkp