nginx-kafka-log-module icon indicating copy to clipboard operation
nginx-kafka-log-module copied to clipboard

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

Open Hubbitus opened this issue 2 years ago • 3 comments

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 avatar Jun 01 '23 17:06 Hubbitus

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

Hubbitus avatar Jun 01 '23 19:06 Hubbitus

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

erankor avatar Jul 22 '23 13:07 erankor

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?

erankor avatar Jul 22 '23 13:07 erankor