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

0.5.0 binary depends on recent GLIBC #94

Open
candlerb opened this issue Jul 17, 2023 · 7 comments
Open

0.5.0 binary depends on recent GLIBC #94

candlerb opened this issue Jul 17, 2023 · 7 comments

Comments

@candlerb
Copy link
Contributor

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
Copy link
Collaborator

tcolgate commented Jul 17, 2023

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

@candlerb
Copy link
Contributor Author

candlerb commented Sep 1, 2023

Link to generic issue: golang/go#57328

@steinbrueckri
Copy link
Contributor

Any update on this?

@tcolgate
Copy link
Collaborator

tcolgate commented Sep 6, 2023

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
Copy link
Contributor

@tcolgate Thx for the fast feedback! ✌️

@StrongTux
Copy link

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
Copy link

paulexyz commented Feb 6, 2024

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.
#102

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

5 participants