nextcloud / docker

⛴ Docker image of Nextcloud
https://hub.docker.com/_/nextcloud/
GNU Affero General Public License v3.0
5.94k stars 1.82k forks source link

Add support for 32k page size (ARM?) to avoid `ELF load command address/offset not page-aligned` #2078

Open DJManas opened 11 months ago

DJManas commented 11 months ago

Hello,

recently QNAP container station switched to 32k page size from 4k and since then I am having problem with update (last working image, that I had tried is NextCloud 26.0.1, tried to update to 26.0.7 and since then I am having problem starting the container up (no matter if its apache, fpm, etc.). I am getting messages like:

/bin/sh: error while loading shared libraries: libc.so.6: ELF load command address/offset not page-aligned

And the container is still restarting. I had searched the internet and it seems that its related to change to 32k page size. I am not sure if i am able to change it back to 4k though (official QNAP support help is... I don't want to be rude).

Is it possible to make images compatible to 32k, maybee backwards compatible, since I want to upgrade from 26.0.1 to latest release (which is I gues to 26.0.7 and then do 27.0.0 and then to latest).

Thanks, Regards, Petr Sourek

joshtrichards commented 11 months ago

https://www.qnap.com/da-dk/how-to/faq/article/why-do-the-installed-third-party-containers-not-run-successfully-on-specific-32-bit-arm-devices

This will likely need to be fixed upstream (either the official community PHP Docker image or the Debian one or Alpine), but I'm honestly not sure. Someone needs to do the leg work to research this matter more, including not only a possible fix for this situation, but a path that makes sure it doesn't break things for others.

I think it's ARM specific.

joshtrichards commented 10 months ago

I was looking to see how other Official Docker Library images have dealt with this and I found:

Though from general searches (i.e. outside Docker Library images) I'm surprised this hasn't come up a bit more often with the Official ones. :thinking:

Wetzel402 commented 9 months ago

Some related posts...

https://gitlab.alpinelinux.org/alpine/aports/-/issues/15167

https://github.com/home-assistant/core/issues/86589#

magicse commented 5 months ago

Also i try experiment in emulation on x86 like this. And get different strange things Alpine Linux 3.18.0 under emulation page size 32k work but give me page size 4K

getconf PAGESIZE
4096

Alpine Linux 3.17.0 under emulation page size 32k give me "bin/sh: getconf: Bad address" on any commands.

And backward on QNAP with pagesize 32K container Alpine Linux 3.17.0 work without problem and Alpine Linux 3.18.0 didnt work at all.

sudo apt-get install qemu binfmt-support qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
for 32K PAGE SIZE
docker run -e "QEMU_CPU=cortex-a15" -e "QEMU_PAGESIZE=32768" --rm --platform linux/arm/v7 -it alpine:3.17.0 /bin/sh
docker run -e "QEMU_CPU=cortex-a15" -e "QEMU_PAGESIZE=32768" --rm --platform linux/arm/v7 -it alpine:3.18.0 /bin/sh

for 4K PAGE SIZE
docker run -e "QEMU_CPU=cortex-a15" -e "QEMU_PAGESIZE=4096" --rm --platform linux/arm/v7 -it alpine:3.17.0 /bin/sh
docker run -e "QEMU_CPU=cortex-a15" -e "QEMU_PAGESIZE=4096" --rm --platform linux/arm/v7 -it alpine:3.18.0 /bin/sh
joshtrichards commented 2 months ago

NextCloud 26.0.1, tried to update to 26.0.7 and since then I am having problem starting the container up

You may be able to workaround this by changing the source image in the Dockerfile and building the image locally - e.g.

https://github.com/nextcloud/docker/blob/747a3f8414e3fad96c44df47b4539d2131523cc9/29/fpm/Dockerfile#L2

Changing from bookworm to bullseye (the Debian version it was previously derived from).

https://github.com/nextcloud/docker/blob/747a3f8414e3fad96c44df47b4539d2131523cc9/29/fpm-alpine/Dockerfile#L2

Changing 3.20 to 3.17.

Caveat: Obviously it's a non-standard build at that point.

DJManas commented 2 months ago

@joshtrichards Thanks I was busy from the bug creation, but now I got to it and ended with the same error on .0.13 so I was about to think of doing what you have written. Well not exactly, firstly I had to search, how to do docker files, etc. And then your comment came. Thanks for that! I have really good starting point. I will try it and will write here how I had ended. Thanks!

jagko commented 1 week ago

Hello, Time flies... Now it is near one year since I get this failure. Is there a change to get it fixed. Or shall i sell my Arm Qnap TS-231P2?

Wetzel402 commented 6 days ago

Hello, Time flies... Now it is near one year since I get this failure. Is there a change to get it fixed. Or shall i sell my Arm Qnap TS-231P2?

This bug has been tracked down to an issue with binutils and a bug report has been opened. With that said, I'm not sure if/when it will get fixed. If fixed, it will also take time to roll out to projects that depend on it.

I needed more space so when I upgraded to an 8 bay QNAP I made sure it was an x86 based unit...