Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zaneclaes opened this issue Sep 20, 2023 · 3 comments
Open

Comments

@zaneclaes
Copy link

(this is a repost from DataDog/dd-trace-php#2265 (comment))

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 zaneclaes changed the title Recent releases stopped working on nignx+alpine, causing the nginx server to crash on boot Upgrading v1.1.4 -> v1.3.7 causes nginx alpine server to crash on boot Sep 20, 2023
@dgoffredo
Copy link
Contributor

dgoffredo commented Sep 20, 2023

Hi, Zane.

I don't think that dd-opentracing-cpp's plugin was ever intended to work with Alpine, but there's no reason that it shouldn't.

Here are two ideas, separate from each other:

  1. Adding --without-libidn2 to
    ./configure --prefix="$install_dir" \
    might help. This is what is done in the newer library dd-trace-cpp, which does support Alpine.
  2. If you're willing to change your tracing-related nginx configuration, then you could use our newer nginx module instead, nginx-datadog. It has more features, requires less configuration, uses the newer tracing library, and supports Alpine. The only potential issue is that nginx is very picky about how its dynamic modules are built, so worst case you'd need to build it from source with some modifications. First try one of its github binary releases.

@zaneclaes
Copy link
Author

Thanks, @dgoffredo ... (1) worked for the immediate error, but then a new one appeared (sorry, I had copied it but forgot to respond before I lost it).

I ended up going with (2) and it appears to be working now. Thanks!

@dgoffredo
Copy link
Contributor

I might patch this.

Full support would mean adding Alpine to our CI, which I'd say is not worthwhile for this soon-to-be-deprecated project. But a patch release wouldn't hurt.

@dgoffredo dgoffredo reopened this Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants