Skip to content
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

container with py3.12 fails to run due to kafka-python being an old version, kafka-python-ng replaces it #499

Closed
fsvm88 opened this issue Mar 29, 2024 · 3 comments

Comments

@fsvm88
Copy link

fsvm88 commented Mar 29, 2024

Hello,

I was updating my docker images, and switched the base image python 3.12.

The build runs, but the latest available kafka-python module does not have some py3.12 compat fixes, which leads it to fail at execution with the following:

Traceback (most recent call last):
  File "/usr/local/bin/parsedmarc", line 5, in <module>
    from parsedmarc.cli import _main
  File "/usr/local/lib/python3.12/site-packages/parsedmarc/cli.py", line 19, in <module>
    from parsedmarc import get_dmarc_reports_from_mailbox, watch_inbox, \
  File "/usr/local/lib/python3.12/site-packages/parsedmarc/kafkaclient.py", line 6, in <module>
    from kafka import KafkaProducer
  File "/usr/local/lib/python3.12/site-packages/kafka/__init__.py", line 23, in <module>
    from kafka.consumer import KafkaConsumer
  File "/usr/local/lib/python3.12/site-packages/kafka/consumer/__init__.py", line 3, in <module>
    from kafka.consumer.group import KafkaConsumer
  File "/usr/local/lib/python3.12/site-packages/kafka/consumer/group.py", line 13, in <module>
    from kafka.consumer.fetcher import Fetcher
  File "/usr/local/lib/python3.12/site-packages/kafka/consumer/fetcher.py", line 19, in <module>
    from kafka.record import MemoryRecords
  File "/usr/local/lib/python3.12/site-packages/kafka/record/__init__.py", line 1, in <module>
    from kafka.record.memory_records import MemoryRecords, MemoryRecordsBuilder
  File "/usr/local/lib/python3.12/site-packages/kafka/record/memory_records.py", line 27, in <module>
    from kafka.record.legacy_records import LegacyRecordBatch, LegacyRecordBatchBuilder
  File "/usr/local/lib/python3.12/site-packages/kafka/record/legacy_records.py", line 50, in <module>
    from kafka.codec import (
  File "/usr/local/lib/python3.12/site-packages/kafka/codec.py", line 9, in <module>
    from kafka.vendor.six.moves import range
ModuleNotFoundError: No module named 'kafka.vendor.six.moves'

Investigating a little, I found out that the current maintainer of kafka-python is not the owner, and cannot publish updates to the kafka-python namespace on pypi anymore. He created a fork named kafka-python-ng telling people to switch over.

Simply switching to the fork resolves the runtime issue, and since it's the same codebase I'd expect it to work with little issues, but I did not explicitly test it as I don't have a setup for it.

@davidande
Copy link

same issue on Webtop (ubuntu-kde) trying to setup Parsedmarc failed. kafka-python-ng solved it.

@rwky3gtelecoms
Copy link

This appears to be fixed in 8.12.0

@fsvm88
Copy link
Author

fsvm88 commented Aug 20, 2024

Fixed in 8.12.0. Closing.

@fsvm88 fsvm88 closed this as completed Aug 20, 2024
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

No branches or pull requests

3 participants