QubitProducts / exporter_exporter

A reverse proxy designed for Prometheus exporters
Apache License 2.0
332 stars 55 forks source link

0.5.0 binary depends on recent GLIBC #94

Open candlerb opened 1 year ago

candlerb commented 1 year ago

I was using exporter_exporter 0.4.2 binary just fine under Ubuntu 20.04.

But after upgrading to exporter_exporter 0.5.0 binary, it refuses to start:

Jul 17 11:08:30 prometheus systemd[1]: Started Prometheus Exporter Exporter.
Jul 17 11:08:30 prometheus exporter_exporter[49899]: /opt/exporter_exporter/exporter_exporter: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /opt/exporter_exporter/exporter_exporter)
Jul 17 11:08:30 prometheus exporter_exporter[49899]: /opt/exporter_exporter/exporter_exporter: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /opt/exporter_exporter/exporter_exporter)
Jul 17 11:08:30 prometheus systemd[1]: exporter_exporter.service: Main process exited, code=exited, status=1/FAILURE
Jul 17 11:08:30 prometheus systemd[1]: exporter_exporter.service: Failed with result 'exit-code'.

Comparing the two binaries:

root@prometheus:~# ldd /opt/exporter_exporter-0.4.2.linux-amd64/exporter_exporter
    linux-vdso.so.1 (0x00007ffec3984000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe40efd7000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe40ede5000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fe40f004000)

root@prometheus:~# ldd /opt/exporter_exporter-0.5.0.linux-amd64/exporter_exporter
/opt/exporter_exporter-0.5.0.linux-amd64/exporter_exporter: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /opt/exporter_exporter-0.5.0.linux-amd64/exporter_exporter)
/opt/exporter_exporter-0.5.0.linux-amd64/exporter_exporter: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /opt/exporter_exporter-0.5.0.linux-amd64/exporter_exporter)
    linux-vdso.so.1 (0x00007ffe0dbec000)
    libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f25e210f000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f25e1f1d000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f25e2135000)

root@prometheus:~# ls -l /lib/x86_64-linux-gnu/libc.so.6
lrwxrwxrwx 1 root root 12 Apr  7  2022 /lib/x86_64-linux-gnu/libc.so.6 -> libc-2.31.so

I find this odd, since I thought that in general, pure Go programs are statically linked. e.g.

# ldd /opt/prometheus-2.45.0.linux-amd64/prometheus
    not a dynamic executable

I also notice that the Dockerfile has

ENV CGO_ENABLED=0

Is it intentional that the exporter_exporter release binaries are dynamically linked? If so, perhaps they could be linked against an older version of GLIBC?

tcolgate commented 1 year ago

No, they should be statically linked. I'll take a look at this this evening.

candlerb commented 10 months ago

Link to generic issue: https://github.com/golang/go/issues/57328

steinbrueckri commented 10 months ago

Any update on this?

tcolgate commented 10 months ago

Hi. sorry for the delay, I can't be quite as active on this project now. I have a solution that should make releases more reliable, but I need to find time to get a PR together. I'll try and get to it in the coming 2 weeks

steinbrueckri commented 10 months ago

@tcolgate Thx for the fast feedback! ✌️

StrongTux commented 6 months ago

Any update on this? Can you suggest the appropiate steps to build the app for older systems with older glibc versions? Or to build a system environment to run the binary with newer libc6 version? I've setup a chroot env with newer glib6 version, but Im not sure how this safe/stable is.

paulexyz commented 5 months ago

Found out the same yesterday. Compiled stuff from master and seems working now since the repo switched to a new buildpipeline... You can find from master compiled binaries in my issue. https://github.com/QubitProducts/exporter_exporter/issues/102