crate / cratedb-prometheus-adapter

CrateDB Prometheus Adapter.
Apache License 2.0
60 stars 15 forks source link

Version 0.5.0 fails to start on Linux: version `GLIBC_2.34' not found #121

Closed amotl closed 7 months ago

amotl commented 7 months ago

Problem

# /usr/local/bin/cratedb-prometheus-adapter -config.file /etc/cratedb-prometheus-adapter/config.yml
/usr/local/bin/cratedb-prometheus-adapter: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /usr/local/bin/cratedb-prometheus-adapter)
/usr/local/bin/cratedb-prometheus-adapter: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /usr/local/bin/cratedb-prometheus-adapter)

Thanks for reporting, @WalBeh.

amotl commented 7 months ago

Maybe it was the wrong choice to bump the Golang version on the Docker containers running the builds? See 5c745a81637a.

amotl commented 7 months ago

Overview of glibc versions. Build machines (previous/now) vs. runtime machine. That's probably the culprit: The program is linked to glibc 2.36, thus it is not compatible with previous versions, right?

# Golang 1.16
$ docker run --rm -it golang:1.16 ldd --version
ldd (Debian GLIBC 2.31-13+deb11u2) 2.31

# Golang 1.21
$ docker run --rm -it golang:1.21 ldd --version
ldd (Debian GLIBC 2.36-9+deb12u3) 2.36

# Debian 11
$ docker run --rm -it debian:bullseye-slim ldd --version
ldd (Debian GLIBC 2.31-13+deb11u7) 2.31
amotl commented 7 months ago

We'd need to go back to Golang 1.18 with the vanilla baseline OCI images.

# Golang 1.18
$ docker run --rm -it golang:1.18 ldd --version
ldd (Debian GLIBC 2.31-13+deb11u5) 2.31

# Golang 1.19
$ docker run --rm -it golang:1.19 ldd --version
ldd (Debian GLIBC 2.36-9+deb12u1) 2.36

# Golang 1.20
$ docker run --rm -it golang:1.20 ldd --version
ldd (Debian GLIBC 2.36-9+deb12u3) 2.36

By choosing a Debian-flavored release, we can still use Golang 1.20, but also better select the glibc version.

$ docker run --rm -it golang:1.20-buster ldd --version
ldd (Debian GLIBC 2.28-10+deb10u2) 2.28
$ docker run --rm -it golang:1.20-bullseye ldd --version
ldd (Debian GLIBC 2.31-13+deb11u7) 2.31
amotl commented 7 months ago

GH-122, and a subsequent release, will resolve this issue.