TheRemote/Legendary-Bedrock-Container

Stops with exit code 0 if I choose an earlier server version

Closed this issue · 6 comments

Set it up on an Oracle Cloud VM running Oracle Linux 8, ARM64. If I leave the Version environment variable blank, then the server works perfectly. But if I choose any other version then it stops almost instantly. Tried hosting a java server instead and that worked fine. I tested it on at least 4 different versions and it's always the same result. Here's the logs:

Minecraft Bedrock Server Docker script by James A. Chambers
,Latest version always at https://github.com/TheRemote/Legendary-Bedrock-Container
,Don't forget to set up port forwarding on your router! The default port is 19132
,Ports used - IPV4: 19132 - IPV6: 19133
,Backing up server (to minecraftbe/backups folder)
,Backing up server (multiple cores) to minecraftbe/backups folder
,worlds/
,worlds/Bedrock level/
,worlds/Bedrock level/db/
,worlds/Bedrock level/db/000005.log
,worlds/Bedrock level/db/MANIFEST-000004
,worlds/Bedrock level/db/CURRENT
,worlds/Bedrock level/levelname.txt
,worlds/Bedrock level/level.dat_old
,worlds/Bedrock level/level.dat
,Checking for the latest version of Minecraft Bedrock server ...
, % Total % Received % Xferd Average Speed Time Time Time Current
, Dload Upload Total Spent Left Speed
,
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 311k 0 311k 0 0 1566k 0 --:--:-- --:--:-- --:--:-- 1566k
,Latest version online is bedrock-server-1.19.10.20.zip
,Override version, using version specified: 1.18.33.02
,Current install is: bedrock-server-1.18.33.02.zip
,Requested version bedrock-server-1.18.33.02.zip is already installed
,Starting Minecraft server...
,tbedrock_server: error while loading shared libraries: libz.so.1: ELF load command alignment not page-aligned
,
,t[screen is terminating]

That is a very strange error. This is on aarch64/ARM64? I tried on my Pi with this exact version:

pi@pi48gb:~ $ uname -a
Linux pi48gb 5.15.32-v8+ #1538 SMP PREEMPT Thu Mar 31 19:40:39 BST 2022 aarch64 GNU/Linux
pi@pi48gb:~ $ sudo docker run -it -v yourvolumename:/minecraft -p 19132:19132/udp -p 19132:19132 -e Version=1.18.33.02 05jchambers/legendary-bedrock-container:latest
Minecraft Bedrock Server Docker script by James A. Chambers
Latest version always at https://github.com/TheRemote/Legendary-Bedrock-Container
Don't forget to set up port forwarding on your router!  The default port is 19132
Ports used - IPV4: 19132 - IPV6: 19133
Backing up server (to minecraftbe/backups folder)
Backing up server (multiple cores) to minecraftbe/backups folder
worlds/
worlds/Bedrock level/
worlds/Bedrock level/db/
worlds/Bedrock level/db/CURRENT
worlds/Bedrock level/db/000019.log
worlds/Bedrock level/db/MANIFEST-000018
worlds/Bedrock level/levelname.txt
worlds/Bedrock level/level.dat_old
worlds/Bedrock level/level.dat
Checking for the latest version of Minecraft Bedrock server ...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  313k    0  313k    0     0   724k      0 --:--:-- --:--:-- --:--:--  724k
Latest version online is bedrock-server-1.19.10.20.zip
Override version, using version specified: 1.18.33.02
Current install is: bedrock-server-1.18.33.02.zip
Requested version bedrock-server-1.18.33.02.zip is already installed
Starting Minecraft server...

But you don't get this with the latest version or when leaving it blank? Specifically I'm looking at this error:

bedrock_server: error while loading shared libraries: libz.so.1: ELF load command alignment not page-aligned

That doesn't seem like something that would go away by changing versions so this is very strange. Can you try clearing everything out in your "downloads" folder located in your volume that stores your Minecraft server data? I almost wonder if something is corrupted in there.

You could also try clearing installed_version.txt and pin_version.txt for sure as well. The only thing that makes me a little unsure is I don't see why the version would change this (or setting the environment variable would).

You also tested several different versions. That would lead me to believe it might be architecture related except the latest version works. The environment variable doesn't do too much (at least not in my code) other than change the URLs that it downloads/installs bedrock_server from basically. It may be triggering some kind of architecture related bug still though although I'm not sure how yet.

Definitely make sure you are running the latest version of the container as well with:

docker pull 05jchambers/legendary-bedrock-container:latest

as I did fix something yesterday that could be related to this. Can you investigate those and let's see if we can get any closer here!

Thanks for getting back to me and yes it's aarch64.

I did try changing the installed_version.txt and also deleted the whole volume multiple times and used different names for it. I've used the latest version of the container every time and these are the logs of a fresh volume running the latest server version:

caution: excluded filename not matched:  *whitelist.json*
caution: excluded filename not matched:  *valid_known_packs.json*
Starting Minecraft server...
t[2022-06-02 11:13:29] NO LOG FILE! - setting up server logging...
[2022-06-02 11:13:29] [2022-06-02 11:13:29:770 INFO] Starting Server
[2022-06-02 11:13:29] [2022-06-02 11:13:29:773 INFO] Version 1.19.10-beta20
[2022-06-02 11:13:29] [2022-06-02 11:13:29:773 INFO] Session ID 85e9a1ab-5f19-4805-848b-c9797765b2be
[2022-06-02 11:13:29] [2022-06-02 11:13:29:793 INFO] Level Name: Bedrock level
[2022-06-02 11:13:29] [2022-06-02 11:13:29:811 ERROR] Error opening allow list file: allowlist.json
[2022-06-02 11:13:29] [2022-06-02 11:13:29:813 INFO] Game mode: 0 Survival
[2022-06-02 11:13:29] [2022-06-02 11:13:29:814 INFO] Difficulty: 1 EASY
[2022-06-02 11:13:29] [2022-06-02 11:13:29:304 INFO] opening worlds/Bedrock level/db
[2022-06-02 11:13:42] [2022-06-02 11:13:42:038 INFO] IPv4 supported, port: 19132
[2022-06-02 11:13:42] [2022-06-02 11:13:42:044 INFO] IPv6 not supported
[2022-06-02 11:13:45] [2022-06-02 11:13:45:933 INFO] Server started.
[2022-06-02 11:13:45] [2022-06-02 11:13:45:988 INFO] ================ TELEMETRY MESSAGE ===================
[2022-06-02 11:13:45] [2022-06-02 11:13:45:988 INFO] Server Telemetry is currently not enabled. 
[2022-06-02 11:13:45] [2022-06-02 11:13:45:989 INFO] Enabling this telemetry helps us improve the game.
[2022-06-02 11:13:45] [2022-06-02 11:13:45:989 INFO] 
[2022-06-02 11:13:45] [2022-06-02 11:13:45:989 INFO] To enable this feature, add the line 'emit-server-telemetry=true'
[2022-06-02 11:13:45] [2022-06-02 11:13:45:990 INFO] to the server.properties file in the handheld/src-server directory
[2022-06-02 11:13:45] [2022-06-02 11:13:45:990 INFO] ======================================================
[2022-06-02 11:13:45] [2022-06-02 11:13:45:046 INFO] IPv4 supported, port: 37044
[2022-06-02 11:13:45] [2022-06-02 11:13:45:046 INFO] IPv6 not supported
cd /varl� � li� �� �� �/lib

But then after deleting the volume and doing this:

docker volume create bedrock-server
docker run -it -v bedrock-server:/minecraft -e Version=1.18.33.02 -p 19132:19132/udp -p 19132:19132 05jchambers/legendary-bedrock-container:latest

I get this:

caution: excluded filename not matched:  *whitelist.json*
caution: excluded filename not matched:  *valid_known_packs.json*
Starting Minecraft server...
tbedrock_server: error while loading shared libraries: libz.so.1: ELF load command alignment not page-aligned

t[screen is terminating]

It's honestly baffling me right now.

Absolutely! The baffling part isn't necessarily the error itself. It's basically that it's loaded completely the same way. It's just a different file basically.

The library itself is copied in the Docker build step from the base Ubuntu image:

COPY --from=builder /lib/x86_64-linux-gnu/libz.so.1 /lib/x86_64-linux-gnu/libz.so.1

QEMU itself is also copied from the host builder container (meaning it's standard, nothing I built or grabbed off the internet, it's from the Ubuntu official base image).

https://marcellomorettoni.wordpress.com/2019/02/12/apigateway-error-while-loading-shared-libraries-libz-so-1/

This looks promising. This guy says that Oracle tends to lock their tmp volume for writing. What doesn't make sense is why doesn't it happen with the latest version but I think some sort of host configuration issue is the only thing that can explain this. We've basically even ruled out architecture at this point.

I found this again here: https://zindo.info/docker-compose-error-while-loading-libz-so-1.html

and again here: https://ogeek.cn/qa/?qa=270252/&show=270253

Yep, I'm pretty sure this has to be it. Can you try on your host:

sudo mount /tmp -o remount,exec

I can't explain why it's not happening with the latest version but I think this is what we have to be dealing with here. Can you investigate and see if it's Oracle's /tmp file restrictions?

This is what I'm getting:

[root@minecraft-server /]# sudo mount /tmp -o remount,exec
mount: /tmp: mount point not mounted or bad option.

It's probably /var/tmp on your system or something like that. It's a permissions issue basically.

Have you tried running the container as sudo? If the system is configured with the right permissions that isn't typically necessary (with the user in the group docker and all of that). Given the nature of this error I would try it as sudo and see if it works (it doesn't mean you have to keep running it that way, it would just be for a test).

https://support.oracle.com/knowledge/Oracle%20Linux%20and%20Virtualization/1609931_1.html

I don't have Oracle access so I can't read this article but this is definitely an Oracle configuration problem. Specifically it seems like your temp folder has noexec on it (wherever that is on Oracle Linux).

Here's another one: https://support.oracle.com/knowledge/Middleware/1918909_1.html

These aren't specifically for Docker but it's the same shared library error that is definitely present. This one is specifically for Docker though: https://developpaper.com/angry-liver-all-night-dockers-common-problems-and-solutions-have-been-exhausted-and-are-about-to-crack/

That issue is #3 on the most common Docker configuration issues. It's related to temp folder permissions. From what I can tell it's probably /var/tmp.

Some more links:

https://developpaper.com/solution-to-tns-permission-denied-in-linux/
https://support.oracle.com/knowledge/Oracle%20Database%20Products/1421013_1.html
https://support.oracle.com/knowledge/Middleware/1918909_1.html

Basically it looks like this is permissions related and I'm having no trouble finding references to the issue and commands to run to fix it (there's some more links in there). I don't have one of these setups though so I can't tell you which one will work!

Going to close for now. If you have more information or get a chance to try this let me know!

If others encounter this or this doesn't get it let me know and we can investigate further!