itzg / docker-minecraft-bedrock-server

Containerized Minecraft Bedrock Dedicated Server with selectable version
MIT License
1.14k stars 219 forks source link

Error: PageSize configuration is wrong: configured with 4096, but got 65536 #348

Open travisboss opened 1 year ago

travisboss commented 1 year ago
[+] Running 1/1
 ⠿ Container mc-bedrock  Started                                                                                  0.4s
DEBU[0000] Using /data to match uid and gid
DEBU[0000] Resolved UID=0 from match path
DEBU[0000] Resolved GID=0 from match path
Looking up latest version...
Starting Bedrock server...
Error: PageSize configuration is wrong: configured with 4096, but got 65536
  mc-bedrock:
    image: itzg/minecraft-bedrock-server
    container_name: mc-bedrock
    environment:
      EULA: "TRUE"
      GAMEMODE: survival
      DIFFICULTY: normal
    ports:
      - 19134:19132/udp
    volumes:
      - ./minecraft-bedrock-data:/data
    stdin_open: true
    tty: true

Trying to figure out this error, I have changed the port for now since I am running mc-java with geyersmc on another container, checked server.properties but see nothing related to this issue. I am running on a ARM oracle free tier.

itzg commented 1 year ago

It seems to be something about hugepages

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/performance_tuning_guide/s-memory-transhuge

That's a pretty advanced topic, so you'll need to explore from there.

BTW, Mojang only provides x86 binary, so the ARM image running in a box64 emulator -- which adds to the challenge of your scenario.

snakeeater98 commented 11 months ago

Was there a solution found? I get the same error.

Edit: its probably because im on arm and the guy originally reporting this probably as well. Surprising that it executed something nontheless. Edit2: It is executing something because i assume you are using box64 as emulation layer wich has a fixed pagesize at 4k. It looks like it is possible to make it other sizes, but i guess this requires building the thing. Also with a fixed pagesize build into the emulation layer its not really universally usable. https://github.com/ptitSeb/box64/issues/912

itzg commented 11 months ago

Good find @snakeeater98 !

snakeeater98 commented 11 months ago

Not exaclty a solution, but a "workaround" for this problem assuming the goal is to play with the bedrock client on a server hostet on arm. Just set up a java server and install the Geyser mod to be able to connect with a bedrock client to a java server.

travisboss commented 11 months ago

That is my currently workflow of just using Geyser with a Fabric server.

itzg commented 9 months ago

Just wanted to note that using one of the other packages for the arm64 image build might help, but runs the risk of being less portable (maybe)

https://box64.debian.ryanfortner.dev/#package-list

HankB commented 9 months ago

The Raspberry Pi 5 is configured to run with a 16K page size whereas earlier Pis were all configured with a 4K page size.

I don't know if the issue is Docker or Java VM. Java reports

hbarta@nova:~ $ java --version
openjdk 17.0.9 2023-10-17
OpenJDK Runtime Environment (build 17.0.9+9-Debian-1deb12u1)
OpenJDK 64-Bit Server VM (build 17.0.9+9-Debian-1deb12u1, mixed mode)
hbarta@nova:~ $

Copied from #380 per @itzg who further commented

...BTW, Bedrock edition doesn't run with Java. It's a native executable so the issue is with Bedrock itself most likely.

and

...wait, on ARM64 it's emulated with box64 so it's actually going to be something with that.

HankB commented 9 months ago

I see that BOX64 recently added support for the Pi 5 https://github.com/ptitSeb/box64/commit/9b7b91651de28bb5b95cef6e07e4e4f3f333c30c and which includes

  • Split RPi5 in 16k page-size variant and not

Could this be the solution for the Pi 5? I'm not sure if this is what you are referring to with your comment above "... using one of the other packages."

itzg commented 9 months ago

Good find @HankB but will be step one of several.

I'd really prefer you switch to Java edition with geyser like most of us have.

https://docker-minecraft-server.readthedocs.io/en/latest/misc/examples/#bedrock-compatible-server

Mojang's bedrock server software is very buggy and I'd prefer to not spend all the effort for numerous ARM variants when the provided binary is x86 to begin with.

HankB commented 9 months ago

I'd really prefer you switch to Java edition with geyser ...

Thanks for the suggestion. I'm not wedded to any particular solution and really prefer the lowest friction (read lowest effort on my part) solution to get a minecraft server running.

I just did a search for "minecraft server Java edition with geyser raspberry pi" and first hit is https://jamesachambers.com/minecraft-java-bedrock-server-together-geyser-floodgate/. Are you familiar with that or are there better instructions you can recommend?

itzg commented 9 months ago

I would highly recommend the example I posted. That article is somebody else's image 😀

DuncanMillard commented 9 months ago

I'd really prefer you switch to Java edition with geyser like most of us have

Would be ideal, but as far as I can tell, no server that lets me use geyser will also let my kids play split-screen on the xbox, sadly. (Known issue in various places - player 2 just hangs).

CrashTestDummy commented 9 months ago

Force your Pi5 to load the common 64-bit kernel that uses 4k page size (kernel8.img) https://www.raspberrypi.com/documentation/computers/config_txt.html#kernel

Or

Build your own flavor of the arm image and swap box64-generic-arm with box64-rpi5arm64ps16k

DuncanMillard commented 9 months ago

Build your own flavor of the arm image and swap box64-generic-arm with box64-rpi5arm64ps16k

No need to build your own now - Ryan has kindly added precompiled versions in the last 36 hours: (https://github.com/ryanfortner/box64-debs/issues/26)

I've now used the Pi 5 / 16Kb page image one to run the official bedrock server fine 👍🏻

Set up the package source with the instructions at https://github.com/ryanfortner/box64-debs then just sudo apt install box64-rpi5arm64ps16k

BenediktHengefeld commented 9 months ago

Maybe someone can help me with this. I'm not sure what exactly @DuncanMillard did, to get it running.

I tried to do the same as Duncan - but I'm not really familiar with debian and all this containers - so probably I did some stupid mistakes..

The error I get in my log files:

Starting Bedrock server...
Error: PageSize configuration is wrong: configured with 4096, but got 16384

What I did so far: 1) Installed my Raspberry PI 5b with the latest Raspberry Pi Imager (v1.8.4) and selected the Raspberry Pi OS Lite 64bit(2023-12-11). 2) Updated and upgraded all repositories and packages 3) Installed latest Docker 4) Installed latest Portainer (just for checking 5) Deployed the bedrock container, with standard command for testing: docker run -d -it -e EULA=TRUE -p 19132:19132/udp -v mc-bedrock-data:/data itzg/minecraft-bedrock-server But got the page size problem as mentioned above.

6) Tried to fix the page size problem as follows (on the Raspberry – not in the container):

sudo wget https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list
wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg 
sudo apt update && sudo apt install box64-rpi4arm64 -y

Got some security errors, so just bypassed in a dirty way the checks by:

sudo apt -o Acquire::AllowInsecureRepositories=true update
sudo apt install box64-rpi5arm64ps16k

Output from the system:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  box64-rpi5arm64ps16k
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 9,059 kB of archives.
After this operation, 66.0 MB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  box64-rpi5arm64ps16k
Install these packages without verification? [y/N] y
Get:1 https://box64.debian.ryanfortner.dev/debian ./ box64-rpi5arm64ps16k 0.2.7+20240105.9b23c32-1 [9,059 kB]
Fetched 9,059 kB in 3s (2,885 kB/s)
Selecting previously unselected package box64-rpi5arm64ps16k.
(Reading database ... 56555 files and directories currently installed.)
Preparing to unpack .../box64-rpi5arm64ps16k_0.2.7+20240105.9b23c32-1_arm64.deb ...
Unpacking box64-rpi5arm64ps16k (0.2.7+20240105.9b23c32-1) ...
Setting up box64-rpi5arm64ps16k (0.2.7+20240105.9b23c32-1) ...
Restarting systemd-binfmt...

So looks like installation was successfull this time. Just double checked again:

sudo apt install box64-rpi5arm64ps16k -y Reading package lists... Done Building dependency tree... Done Reading state information... Done box64-rpi5arm64ps16k is already the newest version (0.2.7+20240105.9b23c32-1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

7) Restarted the Pi

8) Tried to restart the container, still the same problem.

Not sure which of the concepts I misunderstood, would be great if someone could give me a hint. Maybe I have to add the box64 package in the container itself? But as the container crashes, I can’t connect to it via bash to install the package for testing. And no clue how to enhance the container. :(

Sorry for the long text and thanks for your help!

itzg commented 9 months ago

@BenediktHengefeld it requires a change to the image so that the arm64 emulator running within the container is large page aware.

itzg commented 9 months ago

...but please just switch to https://docker-minecraft-server.readthedocs.io/en/latest/misc/examples/#bedrock-compatible-server

Phil-T1 commented 7 months ago

This is awesome, runs much better than Bedrock, thanks!

Just to confirm, the Java version runs full 64 bit and not emulated like in Bedrock?

itzg commented 7 months ago

@Phil-T1 thats correct