librdkafka
librdkafka copied to clipboard
No provider for SASL mechanism GSSAPI: recompile librdkafka with libsasl2 or openssl support. Current build options: PLAIN
I have a project connecting to Confluent Kafka and SARAMA kafka both. The connection fails for Confluent kafka only with the below error: Failed to create Producer: No provider for SASL mechanism GSSAPI: recompile librdkafka with libsasl2 or openssl support. Current build options: PLAIN
I see this was faced by people earlier as well, and I have gone through those issues but could not resolve this.
I am trying to setup things in an Ubuntu system. Here is what my docker file looks like:
WORKDIR /opt
RUN apt-get update
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y install krb5-user libpam-krb5
ENV DEBIAN_FRONTEND=interactive
RUN apt-get -y install libsasl2-dev
RUN apt-get -y install libsasl2-modules-gssapi-mit
RUN
git clone https://github.com/edenhill/librdkafka.git &&
cd librdkafka &&
./configure --prefix /usr &&
make clean &&
make &&
make install &&
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig/
After this I build my project with the -tags dynamic tag. I am using go 1.18.3. This seems to be working for other projects on 1.16 go version.
Please help on this
Originally posted by @paritosh-96 in https://github.com/edenhill/librdkafka/discussions/3962
@edenhill
Does this help?
Make sure the openssl and libssl-dev packages are installed.
You only have libsasl2-dev
Reconfigure and rebuild librdkafka (
./configure --reconfigure && make). Verify thatWITH_SSLis set to 1 inconfig.h
https://github.com/edenhill/librdkafka/wiki/Using-SSL-with-librdkafka
Also suggested in linked post, add --enable-ssl flag to configure
If you are on Ubuntu you can add the Confluent clients APT repository and use those packages directly, which feature GSSAPI support.
See instructions here and make sure you add the clients repository: https://docs.confluent.io/platform/current/installation/installing_cp/deb-ubuntu.html#configure-cp
@paritosh-96 Were you able to resolve the GSSAPI issue?
facing similar issue here
were you able to resolve it? @paritosh-96
Hi! What have work for me was to follow this: https://github.com/confluentinc/confluent-kafka-python/blob/master/INSTALL.md?plain=1.
for my issues (trying to test the connection to kafka using the airflow already build provider apache-airflow-providers-apache-kafka==1.5.0 which relies on the librdkafka), I found i did not understand the error message properly.
my error message:
cimpl.KafkaException: KafkaError{code=_INVALID_ARG,val=-186,str="Failed to create producer: No provider for SASL mechanism GSSAPI: recompile librdkafka with libsasl2 or openssl support. Current build options: PLAIN SASL_SCRAM OAUTHBEARER"}
by reading the error messasge, I kept on thinking that
security.protocol
was configured wrong.
but instead:
error was fixed by adding below
"sasl.mechanism": "PLAIN",
I did not read the error message carefully. it was actually telling me (indirectly) that the configuration(SASL.mechanism) was default to GSSAPI, and the current options are PLAIN SASL_SCRAM OAUTHBEARER
for my testing purpose, I was fine with 'PLAIN' I did not notice/know that sasl.mechanism was something configurable.