kaltura / nginx-kafka-log-module

Send Kafka messages from Nginx
BSD 2-Clause "Simplified" License
64 stars 22 forks source link

dlopen() "/etc/nginx/modules/ngx_http_kafka_log_module.so" failed (/etc/nginx/modules/ngx_http_kafka_log_module.so: undefined symbol: rd_kafka_flush #15

Open Hubbitus opened 1 year ago

Hubbitus commented 1 year ago

Hello.

I've tried to build your module dynamically and build was successful.

But on inserting:

load_module /etc/nginx/modules/ngx_http_kafka_log_module.so;

I've got error:

dlopen() "/etc/nginx/modules/ngx_http_kafka_log_module.so" failed (/etc/nginx/modules/ngx_http_kafka_log_module.so: undefined symbol: rd_kafka_flush

I have already installed librdkafka:

$ podman run -it --rm localhost/my-nginx-kafka:_20230601_192255 find /usr -iname 'librdkafka.so*'
/usr/lib/x86_64-linux-gnu/librdkafka.so.1

What also strange, I do not see linking to it:

$ podman run -it --rm localhost/my-nginx-kafka:_20230601_192255 ldd /etc/nginx/modules/ngx_http_kafka_log_module.so
        linux-vdso.so.1 (0x00007ffd877d2000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f55e91f2000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f55e93d2000)

Am I wrong?

Hubbitus commented 1 year ago

Looks like related to https://github.com/kaltura/nginx-kafka-log-module/issues/5 (https://github.com/kaltura/nginx-kafka-log-module/pull/6).

erankor commented 1 year ago

Maybe you have librdkafka installed on the build environment/container, but you don't have its 'so' file in the runtime container?

erankor commented 1 year ago

Hmm actually I see that the error is about a specific symbol - rd_kafka_flush, did you check whether librdkafka.so is exporting this function?