exporter_exporter icon indicating copy to clipboard operation
exporter_exporter copied to clipboard

0.5.0 binary depends on recent GLIBC

Open candlerb opened this issue 2 years ago • 10 comments

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?

candlerb avatar Jul 17 '23 10:07 candlerb

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

tcolgate avatar Jul 17 '23 10:07 tcolgate

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

candlerb avatar Sep 01 '23 12:09 candlerb

Any update on this?

steinbrueckri avatar Sep 06 '23 09:09 steinbrueckri

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

tcolgate avatar Sep 06 '23 12:09 tcolgate

@tcolgate Thx for the fast feedback! ✌️

steinbrueckri avatar Sep 06 '23 12:09 steinbrueckri

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.

StrongTux avatar Jan 20 '24 05:01 StrongTux

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

paulexyz avatar Feb 06 '24 10:02 paulexyz