alpinelinux / docker-alpine

Official Alpine Linux Docker image. Win at minimalism!
MIT License
1.1k stars 263 forks source link

Error relocating /usr/lib/libcurl.so.4: SSL_get0_group_name: symbol not found #383

Open exfly opened 7 months ago

exfly commented 7 months ago
docker run --rm -it registry-1.docker.io/library/alpine:edge sh -c 'cat /etc/os-release && apk add curl && curl bing.com'
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.20.0_alpha20240315
PRETTY_NAME="Alpine Linux edge"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
fetch https://dl-cdn.alpinelinux.org/alpine/edge/main/aarch64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/edge/community/aarch64/APKINDEX.tar.gz
(1/10) Installing ca-certificates (20240226-r0)
(2/10) Installing brotli-libs (1.1.0-r1)
(3/10) Installing c-ares (1.27.0-r0)
(4/10) Installing libunistring (1.2-r0)
(5/10) Installing libidn2 (2.3.7-r0)
(6/10) Installing nghttp2-libs (1.60.0-r0)
(7/10) Installing libpsl (0.21.5-r1)
(8/10) Installing zstd-libs (1.5.5-r9)
(9/10) Installing libcurl (8.6.0-r1)
(10/10) Installing curl (8.6.0-r1)
Executing busybox-1.36.1-r21.trigger
Executing ca-certificates-20240226-r0.trigger
OK: 13 MiB in 24 packages
Error relocating /usr/lib/libcurl.so.4: SSL_get0_group_name: symbol not found

tmp workaround:

apk update && apk upgrade
tianon commented 7 months ago

Due to it being a linker error, even just curl --version fails (and I don't think it's limited to just curl either, that's just a high-profile and obvious example) :sob:

I think the underlying cause is this:

$ docker run --rm --pull=always alpine:edge apk list --upgradeable --no-cache libssl3
edge: Pulling from library/alpine
Digest: sha256:67b8a3c4c19bbdd43de723881bc536758f5e780f8d32ef8f5ef2b72f769a3e78
Status: Image is up to date for alpine:edge
fetch https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
libssl3-3.2.1-r1 x86_64 {openssl} (Apache-2.0) [upgradable from: libssl3-3.1.5-r5]

I'm not sure what standard practice is in the Alpine packaging ecosystem, but I think this update probably should include a versioned dependency for any package (re)built against it to ensure it gets updated if they get installed? Alternatively, a fresh rebuild of alpine:edge should also make this go away.

tianon commented 7 months ago

It goes deeper than just libssl3, so the rebuild solution is probably the most tenable:

$ docker run -it --rm --pull=always alpine:edge
edge: Pulling from library/alpine
Digest: sha256:67b8a3c4c19bbdd43de723881bc536758f5e780f8d32ef8f5ef2b72f769a3e78
Status: Image is up to date for alpine:edge
/ # apk update --quiet
/ # apk add curl
(1/10) Installing ca-certificates (20240226-r0)
(2/10) Installing brotli-libs (1.1.0-r1)
(3/10) Installing c-ares (1.27.0-r0)
(4/10) Installing libunistring (1.2-r0)
(5/10) Installing libidn2 (2.3.7-r0)
(6/10) Installing nghttp2-libs (1.60.0-r0)
(7/10) Installing libpsl (0.21.5-r1)
(8/10) Installing zstd-libs (1.5.6-r0)
(9/10) Installing libcurl (8.6.0-r1)
(10/10) Installing curl (8.6.0-r1)
Executing busybox-1.36.1-r21.trigger
Executing ca-certificates-20240226-r0.trigger
OK: 13 MiB in 24 packages
/ # curl --version
Error relocating /usr/lib/libcurl.so.4: SSL_get0_group_name: symbol not found
/ # apk upgrade libssl3
(1/1) Upgrading libssl3 (3.1.5-r5 -> 3.2.1-r1)
OK: 13 MiB in 24 packages
/ # curl --version
Error relocating /lib/libssl.so.3: BIO_err_is_non_fatal: symbol not found
Error relocating /lib/libssl.so.3: BIO_s_dgram_mem: symbol not found
Error relocating /lib/libssl.so.3: OSSL_STACK_OF_X509_free: symbol not found
Error relocating /lib/libssl.so.3: OSSL_ERR_STATE_restore: symbol not found
Error relocating /lib/libssl.so.3: ERR_count_to_mark: symbol not found
Error relocating /lib/libssl.so.3: BIO_get_rpoll_descriptor: symbol not found
Error relocating /lib/libssl.so.3: BIO_get_wpoll_descriptor: symbol not found
Error relocating /lib/libssl.so.3: BIO_recvmmsg: symbol not found
Error relocating /lib/libssl.so.3: OSSL_ERR_STATE_save: symbol not found
Error relocating /lib/libssl.so.3: X509_STORE_CTX_init_rpk: symbol not found
Error relocating /lib/libssl.so.3: OSSL_ERR_STATE_new: symbol not found
Error relocating /lib/libssl.so.3: OSSL_ERR_STATE_free: symbol not found
Error relocating /lib/libssl.so.3: BIO_sendmmsg: symbol not found
Error relocating /lib/libssl.so.3: OSSL_ERR_STATE_save_to_mark: symbol not found
/ # apk upgrade libcrypto3
Error relocating /lib/libssl.so.3: BIO_err_is_non_fatal: symbol not found
Error relocating /lib/libssl.so.3: BIO_s_dgram_mem: symbol not found
Error relocating /lib/libssl.so.3: OSSL_STACK_OF_X509_free: symbol not found
Error relocating /lib/libssl.so.3: OSSL_ERR_STATE_restore: symbol not found
Error relocating /lib/libssl.so.3: ERR_count_to_mark: symbol not found
Error relocating /lib/libssl.so.3: BIO_get_rpoll_descriptor: symbol not found
Error relocating /lib/libssl.so.3: BIO_get_wpoll_descriptor: symbol not found
Error relocating /lib/libssl.so.3: BIO_recvmmsg: symbol not found
Error relocating /lib/libssl.so.3: OSSL_ERR_STATE_save: symbol not found
Error relocating /lib/libssl.so.3: X509_STORE_CTX_init_rpk: symbol not found
Error relocating /lib/libssl.so.3: OSSL_ERR_STATE_new: symbol not found
Error relocating /lib/libssl.so.3: OSSL_ERR_STATE_free: symbol not found
Error relocating /lib/libssl.so.3: BIO_sendmmsg: symbol not found
Error relocating /lib/libssl.so.3: OSSL_ERR_STATE_save_to_mark: symbol not found
/ # # oops, now apk itself is broken 🙈
fossdd commented 4 months ago

works on my end now. could you try apk upgrade -a?

yosifkit commented 4 months ago

This was "fixed" by the alpine:edge snapshot rebuild on 20240606 (https://github.com/docker-library/official-images/pull/16939). The answer is to use a newer alpine:edge image (or apk upgrade -a before installing new packages in edge).

thehowl commented 2 weeks ago

FWIW, I solved this by adding openssl to my apk add list.