Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java 11 compatibility when using docker-minecraft-server #120

Closed
benab opened this issue Mar 2, 2021 · 12 comments
Closed

Java 11 compatibility when using docker-minecraft-server #120

benab opened this issue Mar 2, 2021 · 12 comments

Comments

@benab
Copy link

benab commented Mar 2, 2021

Hello. I just discovered Floodgate a few days ago! I'm excited such a thing exists.

My problem is that I haven't had any luck running a Paper server with the floodgate-bukkit plugin in the latest Java version in docker-minecraft-server.
Each time I copy floodgate-bukkit.jar to the plugins folder and start the server, it results in a Java crash. See logs here: https://controlc.com/32c1b62

For testing I start with an empty /data folder. I start with no plugins, then add Geyser-Spigot.jar, restart the server (no crash), add floodgate-bukkit.jar, restart and get a Java crash as posted above.
The following Java tags all crash: latest (Java 11), openj9-11 (Java 11), java15 (Java 15).

I have gotten the java8 (Java 8) tag to work without crashing.

Here is a general docker-compose I run.
version: "3"

services:
  minecraft:
    image: itzg/minecraft-server
    container_name: mc-paper-creative
    ports:
      - 25100:25565
      - 19100:19132/udp
    environment:
      EULA: "TRUE"
      MOTD: "Welcome to my creative castle"
      ICON: file:///data/icon.png
      OVERRIDE_ICON: "TRUE"
      MODE: creative
      TYPE: "PAPER"
    volumes:
      - ./data:/data
    restart: unless-stopped

Am I doing something incorrectly? I also wonder if this is an issue with the Docker version of Minecraft rather than a Floodgate issue. Any guidance is welcome. Thanks!

@benab benab changed the title Java 11 compatibiity when using docker-minecraft-server Java 11 compatibility when using docker-minecraft-server Mar 2, 2021
@LichLord91
Copy link

LichLord91 commented Mar 2, 2021

Hey Benab,

I use ITZG's docker as well on a pi4 (arm64) with java 15 and have no troubles with geyser/floodgate. (make sure your docker and docker-compose it up to date)

I think if you add some of these environment variables it may help.

I noticed in you log you're only using basic jvm arguments.

"Command Line: -XX:+UseG1GC -Xms1G -Xmx1G paper-1.16.5-508.jar"

its highly recommend to use Aikar's suggested jvm arguments which can be added automatically by the environment variable USE_AIKAR_FLAGS: "true" more info here>
aikar's website and itzg-doc

I'd also bump up the server memory to at least 2gb by adding this environment variable MEMORY: "2G" itzg-doc

So here's what your config should look like

version: "3"

services:
minecraft:
image: itzg/minecraft-server
container_name: mc-paper-creative
ports:
- 25100:25565
- 19100:19132/udp
environment:
EULA: "TRUE"
MOTD: "Welcome to my creative castle"
ICON: file:///data/icon.png
OVERRIDE_ICON: "TRUE"
MODE: creative
TYPE: "PAPER"
USE_AIKAR_FLAGS: "true"
MEMORY: "2G"
volumes:
- ./data:/data
restart: unless-stopped

Try these settings out and see if that helps.

@benab
Copy link
Author

benab commented Mar 3, 2021

LichLord91,
Thanks much for the tips! I added the Aikar flags and the memory variables that you noted.

That didn't help the Java crashes, so I checked the Docker versions. I was running:
-Docker version 20.10.4, build d3cb89e
-docker-compose version 1.23.2, build 1110ad01

It seemed that Docker Compose was very out of date. (Apt had not been managing it!)
I updated Docker Compose to the latest: docker-compose version 1.28.5, build c4eb3a1f

I am still getting the Java crashes. (a boot loop) :(
Unless you have other ideas, I'm not sure what else to do other than use Java8 or build a test VM from scratch to see if the issue reproduces itself.

Thanks again for taking the time to assist!

@LichLord91
Copy link

LichLord91 commented Mar 3, 2021

Hey behab ,

You dont want to run java 8 it's starting to get depreciated for all minecraft related stuff. You said you had this crash on each different java version you tried? When you added aikar's flags did you get a different crash or at least a more detailed report? i believe it may add more detail with those flags.

Otherwise here a break down of the error and what might fix it. This may be an upstream issue with ITZG's docker container and you may want to report it. Mine uses Ubuntu since i use the multi-arch build and yours uses Alpine which is why you may be getting errors while i am not.

This also could be hardware related but i think its more on the library side of things

image

here is a tool i used for the JAVA GC dump analytics

https://gceasy.io/hs-report.jsp?p=YXJjaGl2ZWQvMjAyMS8wMy8zLy0tYXBpLWNjMDc1YjNiLTA3NTktNDA1OC04NmRjLWNlNTVkMjk5ZGFhMDBmYjQ4OWRjLWVhNzctNGY5Zi1hNWQ5LWFkYWE3NWFkNmIxMi50eHQ=&channel=API#crash

Doing a quick google search i see that that this might help.

https://stackoverflow.com/questions/55714251/openjdk-11-on-busybox-crash-on-sigsegv-in-libc-so

You may also try to run the multi-arch build which is based on ubuntu instead.

itzg/minecraft-server:2021.6.0-multiarch-latest for java 15

itzg/minecraft-server:2021.6.0-multiarch for java 11

@Camotoy
Copy link
Member

Camotoy commented Mar 3, 2021

Heyo,

In your crash report under Internal Exceptions, it points to a NoSuchMethod error being the culprit (perhaps an SQL Lite error?). Unfortunately this error doesn't tell us what method is non-existent - do you have normal Minecraft server logs as well?

@benab
Copy link
Author

benab commented Mar 3, 2021

@LichLord91

Yeah! Ubuntu did it! It doesn't matter to me whether I use Ubuntu or Alpine in the image, whatever works!

Otherwise here a break down of the error and what might fix it. This may be an upstream issue with ITZG's docker container and you may want to report it. Mine uses Ubuntu since i use the multi-arch build and yours uses Alpine which is why you may be getting errors while i am not.

Given that the Ubuntu image works, does it appear that it is an issue with ITZG's Alpine docker container?

You may also try to run the multi-arch build which is based on ubuntu instead.

itzg/minecraft-server:2021.6.0-multiarch-latest for java 15

itzg/minecraft-server:2021.6.0-multiarch for java 11

Using the itzg/minecraft-server:2021.6.0-multiarch image worked for me! (see my docker-compose below)

version: "3"
services:
  minecraft:
    image: itzg/minecraft-server:2021.6.0-multiarch
    container_name: mc-paper-creative2
    ports:
      - 25100:25565
      - 19100:19132/udp
    environment:
      EULA: "TRUE"
      OVERRIDE_ICON: "TRUE"
      MODE: creative
      TYPE: "PAPER"
      USE_AIKAR_FLAGS: "true"
      MEMORY: "2G"
    volumes:
      - ./data2:/data
    restart: unless-stopped

Thanks again!

@benab
Copy link
Author

benab commented Mar 3, 2021

@Camotoy

In your crash report under Internal Exceptions, it points to a NoSuchMethod error being the culprit (perhaps an SQL Lite error?). Unfortunately this error doesn't tell us what method is non-existent - do you have normal Minecraft server logs as well?

Thanks. Here's more detail.

@LichLord91 I believe you were asking for this as well.

Here are the Minecraft server logs (I think this is what you mean):

[init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x    8 1000     1000          4096 Mar  3 03:50 /data'
[init] Resolved version given LATEST into 1.16.5
[init] Resolving type given PAPER
[init] Removing old PaperMC versions ...
[init] Downloading PaperMC 1.16.5 (build 509) ...
[init] server.properties already created, skipping
[init] Checking for JSON files.
[init] Setting initial memory to 2G and max to 2G
it] Using Aikar's flags
[init] Starting the Minecraft server...
System Info: Java 11 (OpenJDK 64-Bit Server VM 11.0.10+9) Host: Linux 4.15.0-136-generic (amd64)
Loading libraries, please wait...
2021-03-03 17:47:54,876 main WARN Advanced terminal features are not available in this environment
[17:47:59 INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD'
[17:47:59 INFO]: Reloading ResourceManager: Default, bukkit
[17:48:00 INFO]: Loaded 7 recipes
[17:48:02 INFO]: Starting minecraft server version 1.16.5
[17:48:02 INFO]: Loading properties
[17:48:02 INFO]: This server is running Paper version git-Paper-509 (MC: 1.16.5) (Implementing API version 1.16.5-R0.1-SNAPSHOT)
[17:48:02 INFO]: Debug logging is disabled
[17:48:02 INFO]: Server Ping Player Sample Count: 12
[17:48:02 INFO]: Using 4 threads for Netty based IO
[17:48:02 INFO]: Default game type: CREATIVE
[17:48:02 INFO]: Generating keypair
[17:48:02 INFO]: Starting Minecraft server on *:25565
[17:48:02 INFO]: Using epoll channel type
[17:48:03 INFO]: [Geyser-Spigot] Loading Geyser-Spigot v1.2.0-SNAPSHOT
[17:48:03 INFO]: [floodgate-bukkit] Loading floodgate-bukkit v1.0-SNAPSHOT
[17:48:04 INFO]: [floodgate-bukkit] Loading Floodgate linked player database...
[17:48:04 INFO]: Server permissions file permissions.yml is empty, ignoring it
[17:48:04 INFO]: Preparing level "world"
[17:48:04 INFO]: Preparing start region for dimension minecraft:overworld
[17:48:05 INFO]: Loaded 0 spawn chunks for world world
[17:48:05 INFO]: Preparing spawn area: 0%
[17:48:05 INFO]: Preparing spawn area: 0%
[17:48:05 INFO]: Time elapsed: 714 ms
[17:48:05 INFO]: Preparing start region for dimension minecraft:the_nether
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f4e651de980, pid=60, tid=100
#
# JRE version: OpenJDK Runtime Environment AdoptOpenJDK (11.0.10+9) (build 11.0.10+9)
# Java VM: OpenJDK 64-Bit Server VM AdoptOpenJDK (11.0.10+9, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C  [libc.so.6+0x81980]  _IO_link_in+0x1f0
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P %E" (or dumping to /data/core.60)
#
# An error report file with more information is saved as:
# /tmp/hs_err_pid60.log
[17:48:05 INFO]: Loaded 0 spawn chunks for world world_nether
#
# If you would like to submit a bug report, please visit:
#   https://github.com/AdoptOpenJDK/openjdk-support/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
2021-03-03T17:48:06.175Z	WARN	mc-server-runner	sub-process failed	{"exitCode": -1}
2021-03-03T17:48:06.177Z	INFO	mc-server-runner	Done

Here is the associated Java crash log: https://controlc.com/d528cb3a

@benab
Copy link
Author

benab commented Mar 3, 2021

@LichLord91
Since I now have this working with itzg/minecraft-server:2021.6.0-multiarch Docker tag, shall I close this? Or is it useful to keep it open to troubleshoot the Alpine version?

@Camotoy
Copy link
Member

Camotoy commented Mar 3, 2021

I will keep this open for further investgation.

@LichLord91
Copy link

LichLord91 commented Mar 3, 2021

@LichLord91
Since I now have this working with itzg/minecraft-server:2021.6.0-multiarch Docker tag, shall I close this? Or is it useful to keep it open to troubleshoot the Alpine version?

After reviewing your other comments and the new logs im fairly certain this is an issue with the upstream docker container. Specifically Alpine 3.13 and OpenJDK , here's another article I found that is very similar to the error you had even talks about docker on alpine 3.13 and OpenJDK

https://www.gitmemory.com/issue/AdoptOpenJDK/openjdk-docker/520/786895588

left is yours right is the articles.
image

Benab could you do everyone a favor and open up an issue in the ITZG repo and link this ticket to it? Im sure Itzg would appreciate it and work on fixing. :)

@LichLord91
Copy link

Though to Camo's point and the reason you might be crashing is because Floodgate uses a sqlite db to store the account linking data for bedrock to java players. Could be an issue with the library or something on Alpine and it may be something Floodgate could work around or provide an alternative like a flatfile db/mysql but looks like the issue maybe two fold or just one sided.

Probably why Camo wants to keep it open to investigate further. Either way im glad its working for you now.

There may be nothing for ITZG to do but seeing as this is an issue for others and that other plugins also use SQL light might be worth mentioning to ITZG.

@benab
Copy link
Author

benab commented Mar 4, 2021

@LichLord91

Benab could you do everyone a favor and open up an issue in the ITZG repo and link this ticket to it? Im sure Itzg would appreciate it and work on fixing. :)

Done! Here's the ticket I opened on the ITZG repo: itzg/docker-minecraft-server#791
Thanks for your assistance!

@LichLord91
Copy link

Ahh benab ty. ITZG responded and looks like its even further upstream like i thought.

AdoptOpenJDK/openjdk-docker#520

@Tim203 Tim203 closed this as completed Sep 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants