- Notifications
You must be signed in to change notification settings - Fork919
Description
Description
On centos 7, getting error when importing confluent kafka 2.2.0 in python script.
The confluent-kafka module was built using the source along with librdkafka.
Getting below error when importing the module
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib64/python3.6/site-packages/confluent_kafka/init.py", line 19, in
from .deserializing_consumer import DeserializingConsumer
File "/usr/lib64/python3.6/site-packages/confluent_kafka/deserializing_consumer.py", line 19, in
from confluent_kafka.cimpl import Consumer as _ConsumerImpl
ImportError: /usr/lib64/python3.6/site-packages/confluent_kafka/cimpl.cpython-36m-x86_64-linux-gnu.so: undefined symbol: rd_kafka_event_AlterConsumerGroupOffsets_result
How to reproduce
Build the confluent-kafka rpm using the source with below steps
dnf install -y python3-devel
sed -i -E 's/(name = ")/\1python3-/g' setup.py
python3 setup.py sdist bdist_rpm --release="%{timestamp}%{?dist}" --spec-only --build-requires=python3-devel
SPEC=$(basename $(find -name *.spec) )
rpmbuild -bb dist/"${SPEC}" --define "_sourcedir
pwd
/dist" --define "_specdirpwd
/dist" --define "_rpmdirpwd
/dist" --define 'timestamp %(date +"%Y%m%d%H%M")' --define "debug_package %{nil}"Prerequisite to create the confluent-kafka rpm, create the librdkafka as below
curl -Lhttps://github.com/confluentinc/librdkafka/archive/refs/tags/v2.2.0.tar.gz | tar xzf -
cd librdkafka-2.2.0/
./configure --prefix=/usr
make -j
make install
Install the rpm created on the centos box and then try to import the module.
Checklist
Please provide the following information:
- confluent-kafka-python and librdkafka version (
confluent_kafka.version()
andconfluent_kafka.libversion()
): - Apache Kafka broker version:
- Client configuration:
{...}
- Operating system:
- Provide client logs (with
'debug': '..'
as necessary) - Provide broker log excerpts
- Critical issue