edenhill / kcat

Generic command line non-JVM Apache Kafka producer and consumer
Other
5.46k stars 484 forks source link

kafkacat installed on alpine 3.8 error |LIBSASL|rdkafka#producer-1| No worthy mechs found #262

Open wymes opened 4 years ago

wymes commented 4 years ago

Hi debugging a kafka kerberos based connection issue with my container I installed kafkacat to investigate the connection issue . When I execute kafkacat with all the kerberos options that should work I receive the no worthy mechs found . All the supporting packages look to be in place within the container

kafkacat -V kafkacat - Apache Kafka producer and consumer tool https://github.com/edenhill/kafkacat Copyright (c) 2014-2019, Magnus Edenhill Version v20200428-412-g103b52 (JSON, librdkafka 1.4.2 builtin.features=gzip,snappy,ssl,sasl,regex,lz4,sasl_gssapi,sasl_plain,sasl_scram,plugins,zstd,sasl_oauthbearer)

any guidance would be greatly appreciated

Regards

nigel

edenhill commented 4 years ago

This typically means the libsasl2 modules (distro package) have not been installed.

wymes commented 4 years ago

Hi

I had seen that in another post but when I check the container for the installed packages I have the following

libsasl-2.1.27-r6 - Cyrus Simple Authentication and Security Layer (SASL) library

I built the image adding the following packages from alpine

librdkafka librdkafka-dev cyrus-sasl cyrus-sasl-plain libffi libffi-dev libressl libressl-dev krb

Does the cyrus-sasl install libsasl2 or have I missed something in the packages I have added

Regards

Nigel

edenhill commented 4 years ago

You'll probably need to install cyrus-sasl-gssapi if you need Kerberos support.

diogenes1oliveira commented 4 years ago

You'll probably need to install cyrus-sasl-gssapi if you need Kerberos support.

Is there a reason as to why the necessary packages are commented in the Alpine Dockerfile? Would it try to load Kerberos even if no specific Kerberos-configuration is set?

# Kerberos requires a default realm to be set in krb5.conf, which we can't
# do for obvious reasons. So skip it for now.
#ENV BUILD_DEPS_EXTRA cyrus-sasl-dev
#ENV RUN_DEPS_EXTRA libsasl heimdal-libs krb5

I'm asking that because I'm using the image in a corporate context in which building new images and accessing the Internet to install new packages is quite tricky. If the image came with those libraries installed it would be much easier.

edenhill commented 4 years ago

As the comment says we can't know the user's realm, and it is a required input at installation.

Hubbitus commented 3 years ago

Sorry, adding line into Dokerfile:

RUN apk add --no-cache cyrus-sasl cyrus-sasl-gssapiv2 krb5 openssl ca-certificates                                                                                                                                                                                            

did not break build at all. About which input you are speaking?