Skip to content

TypeError: 'NoneType' object is not iterable #2106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
avloss opened this issue Aug 19, 2020 · 3 comments · Fixed by #2523
Closed

TypeError: 'NoneType' object is not iterable #2106

avloss opened this issue Aug 19, 2020 · 3 comments · Fixed by #2523

Comments

@avloss
Copy link

avloss commented Aug 19, 2020

all_partitions = sorted(self._metadata.partitions_for_topic(topic))

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!

@jeffwidman
Copy link
Contributor

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.

@OlehDziuba
Copy link

Hi, have you found any solution for this?

@dpkp
Copy link
Owner

dpkp commented Mar 12, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants