sgerrand/alpine-pkg-glibc

ERROR: glibc-2.35-r0: trying to overwrite etc/nsswitch.conf owned by alpine-baselayout-data-3.3.0-r2.

andrewrothstein opened this issue ยท 24 comments

stopped working with alpine:3.16 and alpine:edge.

Same here but works until last week with 3.16 without edge repository ! Now also:
ERROR: glibc-2.35-r0: trying to overwrite etc/nsswitch.conf owned by alpine-baselayout-data-3.2.0-r23

Maybe it helps to locate the error

Started getting same error, however it's other way around.

ERROR: alpine-baselayout-data-3.2.0-r23: trying to overwrite etc/nsswitch.conf owned by glibc-2.32-r0.

I am having a similar issue with these libraries, with different glibc versions [ 2.31, 2.35 ], and it seems related to this Commit:

https://git.alpinelinux.org/aports/commit/?h=3.16-stable&id=348653a9ba0701e8e968b3344e72313a9ef334e4

Update: I have managed to do a different Workaround, by forcing the previous version of alpine-baselayout, like this, before running apk -U upgrade:

+ apk add alpine-baselayout=3.2.0-r22
  apk -U upgrade

Same issue here :(

We are facing the same issue.

apk add --force-overwrite works around it.

We havent changed our pipeline or glibc version we still set to,

ARG VERSION_GLIBC=2.34-r0

Our pipeline was working on monday 12/09 NZT,

(1/3) Installing glibc (2.34-r0)
(2/3) Installing glibc-bin (2.34-r0)
(3/3) Installing glibc-i18n (2.34-r0)

but failing on tuesday 13/09 NZT,

(1/3) Installing glibc (2.34-r0)
ERROR: glibc-2.34-r0: trying to overwrite etc/nsswitch.conf owned by alpine-baselayout-data-3.2.0-r23.
(2/3) Installing glibc-bin (2.34-r0)
(3/3) Installing glibc-i18n (2.34-r0)

Can confirm the workaround also unblocking us for now thanks @Trass3r

I am having the same issue using an older version of glibc (2.23-r3)

+1 on this issue with glibc-2.29

0free commented

Hi,
still the error exists with version 2.35-r0

ERROR: glibc-2.35-r0: trying to overwrite etc/nsswitch.conf owned by alpine-baselayout-data-3.3.0-r2

I think the only option is to force overwrite

sudo apk add --force-overwrite glibc-2.35-r0.apk
sudo apk fix --force-overwrite alpine-baselayout-data
b01 commented

apk add --force-overwrite works around it.

This works! Nicely it changes the ERROR to a WARNING so it doesn't hide the fact the issue is still there.

without --force-overwrite

 > [6/6] RUN apk add glibc-2.35-r0.apk:
#9 0.478 fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
#9 0.782 fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
#9 1.169 (1/1) Installing glibc (2.35-r0)
#9 1.170 ERROR: glibc-2.35-r0: trying to overwrite etc/nsswitch.conf owned by alpine-baselayout-data-3.2.0-r23.
#9 1.219 1 error; 27 MiB in 48 packages

with --force-overwrite:

#10 [6/6] RUN apk add --force-overwrite glibc-2.35-r0.apk
#10 0.501 fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
#10 0.752 fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
#10 1.112 (1/1) Installing glibc (2.35-r0)
#10 1.114 WARNING: glibc-2.35-r0: overwriting etc/nsswitch.conf owned by alpine-baselayout-data-3.2.0-r23.
#10 1.155 OK: 27 MiB in 48 packages
#10 DONE 1.3s
m1rm commented

I seem to experience the same issue with the following versions:

ERROR: glibc-2.29-r0: trying to overwrite etc/nsswitch.conf owned by alpine-baselayout-data-3.2.0-r23.

 --force-overwrite

Works Indeed! Thank you

We have previously had this issue in sep 2022 #185 (comment) when using following version,

ARG VERSION_GLIBC=2.34-r0

Recently we upgraded to,

ARG VERSION_GLIBC=2.35-r0

And we now have the issue back again, but we still have the workaround in from last time but not having same effect,

(1/6) Installing glibc (2.35-r0)
WARNING: glibc-2.35-r0: overwriting etc/nsswitch.conf owned by alpine-baselayout-data-3.2.0-r23.

Anyone seen similar?

Weird. Using force-overwrite doesn't fix this issue for me at all:

blue:~# apk add --force-overwrite glibc-2.35-r0.apk
1 error; 111 MiB in 126 packages

Hi everyone and apologies for not having responded to all of your bug reports earlier. Forgive me. I've just released version 2.35-r1 of this package which resolves the cause of this issue. Please upgrade to it when you can.

Thanks for looking at this @sgerrand .

If you're back in the "mood" for some alpine glibc, the 2.35 packages (including this 2.35-r1) still don't seem to install and work properly out-of-the-box due to #176, #175, #181 (and other duplicates) either without lib64 symlinking or other crude approaches like #175 (comment). 2.34-r0 doesn't seem to have this issue.

Thanks for highlighting those points. I'm continuing work on this package this week to resolve those issues, along with updating the version of the GNU C library to the current release.

back in the "mood"

For transparency, some other things had got in the way of spending time on this project. I appreciate that a lot of projects, commercial or otherwise, depend on this Alpine package but until somebody decides to sponsor my time I can only offer "best effort" as a commitment.

If you'd like to change this then please click the "Sponsor" button at the top of the page and complete the workflow to enable me to spend more time supporting this project!

Totally understood, and totally fair enough. I for one, appreciate the effort you've put in to this project thus far. Aside from this package's historical use within AdoptOpenJDK which I was aware of, for some messy reasons this is still used as part of Alpine container images for https://github.com/gocd/gocd - for which I am in a similar maintainer position with respect to "best efforts" :-)

Have been incrementally trying to understand a bit more here to evaluate the various options for creating aarch64/arm64 variants which I can't easily do at the moment. Anyway, sorry for the off-topic messages, and thanks again ๐Ÿ™

@sgerrand the latest binaries you've offered work swimmingly for my use case. thank you for all of your efforts.

Installing glibc-bin-2.35-r1 still has the same problem, and it prevents me from installing other packages and updates.

sudo apk add glibc-bin-2.35-r1.apk glibc-dev-2.35-r1.apk glibc-i18n-2.
35-r1.apk glibc-2.35-r1.apk
1 error; 1672 MiB in 609 packages
peter-pc:~/Downloads/glibc$ sudo apk -U upgrade
fetch https://mirrors.ustc.edu.cn/alpine/latest-stable/main/x86_64/APKINDEX.tar.gz
fetch https://mirrors.ustc.edu.cn/alpine/latest-stable/community/x86_64/APKINDEX.tar.gz
1 error; 1672 MiB in 609 packages
peter-pc:~/Downloads/glibc$ sudo apk upgrade
1 error; 1672 MiB in 609 packages
peter-pc:~/Downloads/glibc$ sudo apk add nginx
(1/5) Installing hiredis (1.2.0-r0)
(2/5) Installing pcre (8.45-r3)
(3/5) Installing nginx (1.24.0-r14)
Executing nginx-1.24.0-r14.pre-install
Executing nginx-1.24.0-r14.post-install
(4/5) Installing nginx-openrc (1.24.0-r14)
(5/5) Installing nginx-vim (1.24.0-r14)
Executing busybox-1.36.1-r15.trigger
Executing glibc-bin-2.35-r1.trigger
1 error; 1674 MiB in 614 packages
b01 commented

@huqingcn Yea, the work-a-round is above. But here it is in practice, not ideal. But this glibc implementation is worth it: https://github.com/kohirens/docker-alpine-glibc/blob/059ea7f865953ca2c23fb6ea9b77845b7c86dbb2/Dockerfile#L19