dd-opentracing-cpp icon indicating copy to clipboard operation
dd-opentracing-cpp copied to clipboard

Upgrading v1.1.4 -> v1.3.7 causes nginx alpine server to crash on boot

Open zaneclaes opened this issue 1 year ago • 3 comments

(this is a repost from https://github.com/DataDog/dd-trace-php/issues/2265#issuecomment-1724832032)

I maintain a Docker image based on wordpress:phpX-fpm-alpine. I recently upgraded dd-opentracing-cpp from v1.1.4 to v1.3.7 (and nginx opentracing from 1.5.1 to 1.6.0). The relevant Dockerfile section is below, which is built using docker buildx build . --platform linux/amd64 (the only thing I changed was the ENV variables to update versions):

ENV NGINX_OPENTRACING_CPP_VERSION="v1.6.0"
ENV DATADOG_OPENTRACING_VERSION="v1.3.7"

RUN cd /usr/src/app && \
    git clone -b $NGINX_OPENTRACING_CPP_VERSION https://github.com/opentracing/opentracing-cpp.git && \
    cd opentracing-cpp && \
    mkdir .build && cd .build && \
    cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF .. && \
    make && make install
RUN cd /usr/src/app && \
    git clone -b $DATADOG_OPENTRACING_VERSION https://github.com/DataDog/dd-opentracing-cpp && \
    cd dd-opentracing-cpp && \
    scripts/install_dependencies.sh && \
    mkdir .build && cd .build && \
    cmake .. && \
    make && make install

Upon doing this, I noticed that the libdd_opentracing.so file moved from /usr/local/lib64 to /usr/local/lib, so I was forced to update the nginx conf:

opentracing_load_tracer /usr/local/lib/libdd_opentracing.so /etc/dd-config.json;

Unfortunately, the nginx server crashes immediately due to the following error:

nginx: [error] Failed to load tracing library /usr/local/lib/libdd_opentracing.so: Error relocating /usr/local/lib/libdd_opentracing.so: idn2_lookup_ul: symbol not found

Due to the change in file location and inability to find the library, I wonder if the recent versions are building for the wrong architecture (?). I tried explicitly installing idn2-utils just to make sure, but I still get the same error.

zaneclaes avatar Sep 20 '23 16:09 zaneclaes