itzg / docker-minecraft-server

Docker image that provides a Minecraft Server that will automatically download selected version at startup
https://docker-minecraft-server.readthedocs.io/
Apache License 2.0
9.23k stars 1.52k forks source link

Server fails to start on fresh install #1284

Closed JoshLoecker closed 2 years ago

JoshLoecker commented 2 years ago

Describe the problem

When starting the docker container with tags java17 or java17-openj9, the server crashes after the message Loading libraries, please wait...

Container definition

version: "3"

services:
  java-survival:
    image: itzg/minecraft-server:java17-openj9
    container_name: java-survival
    ports:
      - 25565:25565
      - 19132:19132
    volumes:
      - ./config:/data
      - ./config/plugins:/plugins
    environment:
      - DEBUG=TRUE
      - TZ=America/Chicago
      - EULA=TRUE
      - TYPE=PAPER
    tty: true
    stdin_open: true
    restart: unless-stopped

Container logs

++ mc-image-helper get --json-path '$.latest.release' https://launchermeta.mojang.com/mc/game/version_manifest.json
+ VANILLA_VERSION=1.18.1
+ export VANILLA_VERSION
+ log 'Resolved version given LATEST into 1.18.1'
+ echo '[init] Resolved version given LATEST into 1.18.1'
[init] Resolved version given LATEST into 1.18.1
+ cd /data
+ export ORIGINAL_TYPE=PAPER
+ ORIGINAL_TYPE=PAPER
+ isTrue false
+ local value=false
+ result=
+ case ${value} in
+ result=1
+ return 1
+ isTrue false
+ local value=false
+ result=
+ case ${value} in
+ result=1
+ return 1
+ versionLessThan 1.7
+ mc-image-helper compare-versions 1.18.1 lt 1.7
+ log 'Resolving type given PAPER'
+ echo '[init] Resolving type given PAPER'
[init] Resolving type given PAPER
+ case "${TYPE^^}" in
+ exec /start-deployPaper
+ [[ -n '' ]]
++ jq '.builds[-1]'
++ curl -fsSL https://papermc.io/api/v2/projects/paper/versions/1.18.1 -H 'accept: application/json'
+ build=154
+ case $? in
+ '[' 0 '!=' 0 ']'
++ jq -r .downloads.application.name
++ curl -fsSL https://papermc.io/api/v2/projects/paper/versions/1.18.1/builds/154 -H 'accept: application/json'
+ export SERVER=paper-1.18.1-154.jar
+ SERVER=paper-1.18.1-154.jar
+ '[' 0 '!=' 0 ']'
+ '[' -f paper-1.18.1-154.jar ']'
+ zarg=(-z "$SERVER")
+ log 'Removing old PaperMC versions ...'
+ echo '[init] Removing old PaperMC versions ...'
[init] Removing old PaperMC versions ...
+ shopt -s nullglob
+ for f in paper-*.jar
+ [[ paper-1.18.1-154.jar != paper-1.18.1-154.jar ]]
+ log 'Downloading PaperMC 1.18.1 (build 154) ...'
+ echo '[init] Downloading PaperMC 1.18.1 (build 154) ...'
[init] Downloading PaperMC 1.18.1 (build 154) ...
+ curl -fsSL -o paper-1.18.1-154.jar -z paper-1.18.1-154.jar https://papermc.io/api/v2/projects/paper/versions/1.18.1/builds/154/downloads/paper-1.18.1-154.jar -H 'accept: application/java-archive'
+ '[' 0 '!=' 0 ']'
+ export TYPE=SPIGOT
+ TYPE=SPIGOT
+ export FAMILY=SPIGOT
+ FAMILY=SPIGOT
+ export SKIP_LOG4J_CONFIG=true
+ SKIP_LOG4J_CONFIG=true
+ exec /start-spiget
+ extraCurlArgs=(-v)
+ :
+ : 5
+ [[ -n '' ]]
+ exec /start-setupWorld
+ '[' SPIGOT = CURSEFORGE ']'
+ worldDest=/data/world
+ [[ -n '' ]]
+ exec /start-setupDatapack
+ out_dir=/data/world/datapacks
+ isTrue false
+ local value=false
+ result=
+ case ${value} in
+ result=1
+ return 1
+ [[ -n '' ]]
+ [[ -n '' ]]
+ exec /start-setupModpack
+ CURSE_URL_BASE=https://minecraft.curseforge.com/projects
+ isTrue false
+ local value=false
+ result=
+ case ${value} in
+ result=1
+ return 1
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ : ''
+ [[ -n '' ]]
+ exec /start-setupModconfig
+ isTrue true
+ local value=true
+ result=
+ case ${value} in
+ result=0
+ return 0
+ updateArg=--skip-newer-in-destination
+ isTrue true
+ local value=true
+ result=
+ case ${value} in
+ result=0
+ return 0
+ subcommand=sync-and-interpolate
+ '[' -d /plugins ']'
+ case ${TYPE} in
+ mkdir -p /data/plugins
+ log 'Copying plugins over...'
+ echo '[init] Copying plugins over...'
[init] Copying plugins over...
+ mc-image-helper --debug=TRUE sync-and-interpolate --skip-newer-in-destination --replace-env-file-suffixes=yml,yaml,txt,cfg,conf,properties,hjson,json,tml,toml --replace-env-excludes= --replace-env-exclude-paths= --replace-env-prefix=CFG_ /plugins /data/plugins
[mc-image-helper] 16:41:50.661 DEBUG : Configured with SyncAndInterpolate(skipNewerInDestination=true, replaceEnv=ReplaceEnvOptions(prefix=CFG_, excludes=[], excludePaths=[], suffixes=[yml, yaml, txt, cfg, conf, properties, hjson, json, tml, toml]), src=/plugins, dest=/data/plugins)
[mc-image-helper] 16:41:50.743 DEBUG : ensuring destinationDirectory=/data/plugins
[mc-image-helper] 16:41:50.757 DEBUG : ensuring destinationDirectory=/data/plugins/bStats
[mc-image-helper] 16:41:50.767 DEBUG : Comparing /plugins/bStats/config.yml (size=337, time=2022-01-16T22:11:29.812680904Z) to /data/plugins/bStats/config.yml (size=337, time=2022-01-16T22:11:29.812680904Z)
[mc-image-helper] 16:41:50.773 DEBUG : Skipping destFile=/data/plugins/bStats/config.yml
+ : /data/mods
+ '[' -d /mods ']'
+ : /data/config
+ '[' -d /config ']'
+ exec /start-setupServerProperties
[init] server.properties already created, skipping
[init] DEBUG Dumping server.properties
#Minecraft server properties
#Sun Jan 16 16:40:36 CST 2022
enable-jmx-monitoring=false
level-seed=
rcon.port=25575
enable-command-block=true
gamemode=survival
enable-query=false
generator-settings=
level-name=world
motd=A Paper Minecraft Server powered by Docker
query.port=25565
texture-pack=
pvp=true
generate-structures=true
difficulty=easy
network-compression-threshold=256
max-tick-time=60000
require-resource-pack=false
max-players=20
use-native-transport=true
online-mode=true
enable-status=true
allow-flight=false
broadcast-rcon-to-ops=true
view-distance=10
max-build-height=256
server-ip=
resource-pack-prompt=
allow-nether=true
server-port=25565
enable-rcon=true
sync-chunk-writes=true
op-permission-level=4
prevent-proxy-connections=false
hide-online-players=false
resource-pack=
entity-broadcast-range-percentage=100
simulation-distance=10
player-idle-timeout=0
rcon.password=minecraft
force-gamemode=false
debug=false
rate-limit=0
hardcore=false
white-list=false
broadcast-console-to-ops=true
spawn-npcs=true
spawn-animals=true
snooper-enabled=true
function-permission-level=2
level-type=DEFAULT
text-filtering-config=
spawn-monsters=true
enforce-whitelist=false
resource-pack-sha1=
spawn-protection=16
max-world-size=29999984
+ versionLessThan 1.7.6
+ mc-image-helper compare-versions 1.18.1 lt 1.7.6
+ opsFile=ops.json
+ whitelistFile=whitelist.json
+ isTrue ''
+ local value=
+ result=
+ case ${value} in
+ result=1
+ return 1
+ '[' -n '' ']'
+ '[' -n '' ']'
+ isTrue ''
+ local value=
+ result=
+ case ${value} in
+ result=1
+ return 1
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ canUseRollingLogs=true
+ versionLessThan 1.7
+ mc-image-helper compare-versions 1.18.1 lt 1.7
+ isFamily VANILLA
+ for f in "${@}"
+ [[ SPIGOT == \V\A\N\I\L\L\A ]]
+ return 1
+ isFamily VANILLA
+ for f in "${@}"
+ [[ SPIGOT == \V\A\N\I\L\L\A ]]
+ return 1
+ versionLessThan 1.18.1
+ mc-image-helper compare-versions 1.18.1 lt 1.18.1
+ isTrue false
+ local value=false
+ result=
+ case ${value} in
+ result=1
+ return 1
+ log 'Checking for JSON files.'
+ echo '[init] Checking for JSON files.'
[init] Checking for JSON files.
++ find /data -maxdepth 1 -name '*.json'
+ JSON_FILES='/data/banned-ips.json
/data/ops.json
/data/version_history.json
/data/whitelist.json
/data/usercache.json
/data/banned-players.json'
+ for j in $JSON_FILES
++ cat /data/banned-ips.json
++ sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'
+ [[ [] == '' ]]
+ for j in $JSON_FILES
++ cat /data/ops.json
++ sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'
+ [[ [] == '' ]]
+ for j in $JSON_FILES
++ sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'
++ cat /data/version_history.json
+ [[ {"currentVersion":"git-Paper-154 (MC: 1.18.1)"} == '' ]]
+ for j in $JSON_FILES
++ sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'
++ cat /data/whitelist.json
+ [[ [] == '' ]]
+ for j in $JSON_FILES
++ cat /data/usercache.json
++ sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'
+ [[ [] == '' ]]
+ for j in $JSON_FILES
++ cat /data/banned-players.json
++ sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'
+ [[ [] == '' ]]
+ versionLessThan 1.14
+ mc-image-helper compare-versions 1.18.1 lt 1.14
+ [[ '' = false ]]
+ [[ '' = FALSE ]]
+ : 1G
+ : 1G
+ expandedDOpts=
+ '[' -n '' ']'
+ isTrue
+ local value=
+ result=
+ case ${value} in
+ result=1
+ return 1
+ isTrue ''
+ local value=
+ result=
+ case ${value} in
+ result=1
+ return 1
+ isTrue ''
+ local value=
+ result=
+ case ${value} in
+ result=1
+ return 1
+ isTrue ''
+ local value=
+ result=
+ case ${value} in
+ result=1
+ return 1
+ isTrue ''
+ local value=
+ result=
+ case ${value} in
+ result=1
+ return 1
+ [[ -n 1G ]]
+ log 'Setting initial memory to 1G and max to 1G'
+ echo '[init] Setting initial memory to 1G and max to 1G'
[init] Setting initial memory to 1G and max to 1G
+ [[ -n 1G ]]
+ JVM_OPTS='-Xms1G '
+ [[ -n 1G ]]
+ JVM_OPTS='-Xmx1G -Xms1G '
+ mcServerRunnerArgs=(--stop-duration "${STOP_DURATION:-60}s" --named-pipe "${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}")
+ [[ -n '' ]]
+ [[ SPIGOT == \C\U\R\S\E\F\O\R\G\E ]]
+ [[ SPIGOT == \C\U\R\S\E\F\O\R\G\E ]]
+ [[ -x run.sh ]]
+ '[' -f /data/bootstrap.txt ']'
+ log 'Starting the Minecraft server...'
+ echo '[init] Starting the Minecraft server...'
[init] Starting the Minecraft server...
+ finalArgs=($JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar "$SERVER" "$@" $EXTRA_ARGS)
+ isTrue false
+ local value=false
+ result=
+ case ${value} in
+ result=1
+ return 1
+ isTrue ''
+ local value=
+ result=
+ case ${value} in
+ result=1
+ return 1
+ isTrue false
+ local value=false
+ result=
+ case ${value} in
+ result=1
+ return 1
+ exec mc-server-runner --stop-duration 60s --named-pipe /tmp/minecraft-console-in java -Xmx1G -Xms1G -jar paper-1.18.1-154.jar
Starting org.bukkit.craftbukkit.Main
System Info: Java 17 (Eclipse OpenJ9 VM openj9-0.29.1) Host: Linux 5.10.0-10-amd64 (amd64)
Loading libraries, please wait...
2022-01-16 16:42:05,893 ServerMain WARN Advanced terminal features are not available in this environment
#0: /opt/java/openjdk/lib/default/libj9jit29.so(+0x8a3885) [0x7f1b5fa7c885]
#1: /opt/java/openjdk/lib/default/libj9jit29.so(+0x8ae9f0) [0x7f1b5fa879f0]
#2: /opt/java/openjdk/lib/default/libj9jit29.so(+0x15afb9) [0x7f1b5f333fb9]
#3: /opt/java/openjdk/lib/default/libj9prt29.so(+0x29d8a) [0x7f1b65806d8a]
#4: /lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0) [0x7f1b672203c0]
#5: /opt/java/openjdk/lib/default/libj9jit29.so(+0x5154ac) [0x7f1b5f6ee4ac]
#6: /opt/java/openjdk/lib/default/libj9jit29.so(+0x92f69e) [0x7f1b5fb0869e]
#7: /opt/java/openjdk/lib/default/libj9jit29.so(+0x922f8f) [0x7f1b5fafbf8f]
#8: /opt/java/openjdk/lib/default/libj9jit29.so(+0x9382e7) [0x7f1b5fb112e7]
#9: /opt/java/openjdk/lib/default/libj9jit29.so(+0x93c2cf) [0x7f1b5fb152cf]
#10: /opt/java/openjdk/lib/default/libj9jit29.so(+0x5142c4) [0x7f1b5f6ed2c4]
#11: /opt/java/openjdk/lib/default/libj9jit29.so(+0x512ea2) [0x7f1b5f6ebea2]
#12: /opt/java/openjdk/lib/default/libj9jit29.so(+0x5104f3) [0x7f1b5f6e94f3]
#13: /opt/java/openjdk/lib/default/libj9jit29.so(+0x5401a9) [0x7f1b5f7191a9]
#14: /opt/java/openjdk/lib/default/libj9jit29.so(+0x16e2fb) [0x7f1b5f3472fb]
#15: /opt/java/openjdk/lib/default/libj9jit29.so(+0x16f337) [0x7f1b5f348337]
#16: /opt/java/openjdk/lib/default/libj9prt29.so(+0x2a8c3) [0x7f1b658078c3]
#17: /opt/java/openjdk/lib/default/libj9jit29.so(+0x16cae9) [0x7f1b5f345ae9]
#18: /opt/java/openjdk/lib/default/libj9jit29.so(+0x16d110) [0x7f1b5f346110]
#19: /opt/java/openjdk/lib/default/libj9jit29.so(+0x16bca3) [0x7f1b5f344ca3]
#20: /opt/java/openjdk/lib/default/libj9jit29.so(+0x16c182) [0x7f1b5f345182]
#21: /opt/java/openjdk/lib/default/libj9jit29.so(+0x16c22a) [0x7f1b5f34522a]
#22: /opt/java/openjdk/lib/default/libj9prt29.so(+0x2a8c3) [0x7f1b658078c3]
#23: /opt/java/openjdk/lib/default/libj9jit29.so(+0x16c622) [0x7f1b5f345622]
#24: /opt/java/openjdk/lib/default/libj9thr29.so(+0xe4b2) [0x7f1b655d04b2]
#25: /lib/x86_64-linux-gnu/libpthread.so.0(+0x9609) [0x7f1b67214609]
#26: /lib/x86_64-linux-gnu/libc.so.6(clone+0x43) [0x7f1b67135293]
Unhandled exception
Type=Segmentation error vmState=0x0005ff06
J9Generic_Signal_Number=00000018 Signal_Number=0000000b Error_Value=00000000 Signal_Code=00000001
Handler1=00007F1B65AA8390 Handler2=00007F1B65806B60 InaccessibleAddress=0000000000004000
RDI=0000000000004000 RSI=000000000000000D RAX=00007F1B01467E80 RBX=00007F1B01467E80
RCX=000000000000000D RDX=0000000000000024 R8=00007F1B3F0066C0 R9=00007F1B01468380
R10=0000000000000048 R11=0000000000000000 R12=000000000000000C R13=0000000000000068
R14=00007F1B014677A8 R15=00007F1B3F006E40
RIP=00007F1B5F6EE4AC GS=0000 FS=0000 RSP=00007F1B4499F4D0
EFlags=0000000000010206 CS=0033 RBP=00007F1B014678E0 ERR=0000000000000004
TRAPNO=000000000000000E OLDMASK=0000000000000000 CR2=0000000000004000
xmm0 0000000000000000 (f: 0.000000, d: 0.000000e+00)
xmm1 00007f1b088a95f0 (f: 143300080.000000, d: 6.904769e-310)
xmm2 00007f1b088ac3d0 (f: 143311824.000000, d: 6.904769e-310)
xmm3 00007f1b088ac250 (f: 143311440.000000, d: 6.904769e-310)
xmm4 00007f1b088ac0d0 (f: 143311056.000000, d: 6.904769e-310)
xmm5 00007f1b088abf50 (f: 143310672.000000, d: 6.904769e-310)
xmm6 00007f1b088abcd0 (f: 143310032.000000, d: 6.904769e-310)
xmm7 00007f1b088abb50 (f: 143309648.000000, d: 6.904769e-310)
xmm8 ffffffff00000000 (f: 0.000000, d: -nan)
xmm9 0000000000000000 (f: 0.000000, d: 0.000000e+00)
xmm10 ff000000000000ff (f: 255.000000, d: -5.486124e+303)
xmm11 0000000000000000 (f: 0.000000, d: 0.000000e+00)
xmm12 0000000000000000 (f: 0.000000, d: 0.000000e+00)
xmm13 0000000000000000 (f: 0.000000, d: 0.000000e+00)
xmm14 0000000000000000 (f: 0.000000, d: 0.000000e+00)
xmm15 0000000000000000 (f: 0.000000, d: 0.000000e+00)
Module=/opt/java/openjdk/lib/default/libj9jit29.so
Module_base_address=00007F1B5F1D9000

Method_being_compiled=net/minecraft/util/datafix/schemas/DataConverterSchemaV1460.registerEntities(Lcom/mojang/datafixers/schemas/Schema;)Ljava/util/Map;
Target=2_90_20211207_75 (Linux 5.10.0-10-amd64)
CPU=amd64 (2 logical CPUs) (0x1d74cf000 RAM)
----------- Stack Backtrace -----------
(0x00007F1B5F6EE4AC [libj9jit29.so+0x5154ac])
(0x00007F1B5FB0869E [libj9jit29.so+0x92f69e])
(0x00007F1B5FAFBF8F [libj9jit29.so+0x922f8f])
(0x00007F1B5FB112E7 [libj9jit29.so+0x9382e7])
(0x00007F1B5FB152CF [libj9jit29.so+0x93c2cf])
(0x00007F1B5F6ED2C4 [libj9jit29.so+0x5142c4])
(0x00007F1B5F6EBEA2 [libj9jit29.so+0x512ea2])
(0x00007F1B5F6E94F3 [libj9jit29.so+0x5104f3])
(0x00007F1B5F7191A9 [libj9jit29.so+0x5401a9])
(0x00007F1B5F3472FB [libj9jit29.so+0x16e2fb])
(0x00007F1B5F348337 [libj9jit29.so+0x16f337])
(0x00007F1B658078C3 [libj9prt29.so+0x2a8c3])
(0x00007F1B5F345AE9 [libj9jit29.so+0x16cae9])
(0x00007F1B5F346110 [libj9jit29.so+0x16d110])
(0x00007F1B5F344CA3 [libj9jit29.so+0x16bca3])
(0x00007F1B5F345182 [libj9jit29.so+0x16c182])
(0x00007F1B5F34522A [libj9jit29.so+0x16c22a])
(0x00007F1B658078C3 [libj9prt29.so+0x2a8c3])
(0x00007F1B5F345622 [libj9jit29.so+0x16c622])
(0x00007F1B655D04B2 [libj9thr29.so+0xe4b2])
(0x00007F1B67214609 [libpthread.so.0+0x9609])
clone+0x43 (0x00007F1B67135293 [libc.so.6+0x122293])
---------------------------------------
JVMDUMP039I Processing dump event "gpf", detail "" at 2022/01/16 16:42:38 - please wait.
JVMDUMP032I JVM requested System dump using '/data/core.20220116.164238.282.0001.dmp' in response to an event
JVMDUMP010I System dump written to /data/core.20220116.164238.282.0001.dmp
JVMDUMP032I JVM requested Java dump using '/data/javacore.20220116.164238.282.0002.txt' in response to an event
JVMDUMP010I Java dump written to /data/javacore.20220116.164238.282.0002.txt
JVMDUMP032I JVM requested Snap dump using '/data/Snap.20220116.164238.282.0003.trc' in response to an event
JVMDUMP010I Snap dump written to /data/Snap.20220116.164238.282.0003.trc
JVMDUMP032I JVM requested JIT dump using '/data/jitdump.20220116.164238.282.0004.dmp' in response to an event
JVMDUMP051I JIT dump occurred in 'JIT Compilation Thread-000' thread 0x0000000000018F00
JVMDUMP049I JIT dump notified all waiting threads of the current method to be compiled
JVMDUMP054I JIT dump is tracing the IL of the method on the crashed compilation thread
JVMDUMP052I JIT dump recursive crash occurred on diagnostic thread
JVMDUMP048I JIT dump method being compiled is an ordinary method
JVMDUMP053I JIT dump is recompiling net/minecraft/util/datafix/schemas/DataConverterSchemaV1460.registerEntities(Lcom/mojang/datafixers/schemas/Schema;)Ljava/util/Map;
JVMDUMP010I JIT dump written to /data/jitdump.20220116.164238.282.0004.dmp
JVMDUMP013I Processed dump event "gpf", detail "".
2022-01-16T16:43:18.967-0600    WARN    mc-server-runner    sub-process failed  {"exitCode": 255}
2022-01-16T16:43:18.969-0600    INFO    mc-server-runner    Done
JoshLoecker commented 2 years ago

I appear to have fixed my issue by removing all files under the /config mount, and restarting the server.

The new debug logs are here, for reference. I don't know what is different

https://pastebin.com/s1vjNmFK

itzg commented 2 years ago

You had a circular reference to your ./config/plugins directory

./config/plugins was mounted to /plugins and /plugins gets copied to /data/plugins and ./config is also mounted at /data. Even if it worked it was going to be a real mess.

JoshLoecker commented 2 years ago

Ahh, I was unaware of that! That would make sense. Would a more sensible approach be to just have the volumes as so?

./config:/data
./plugins:/plugins
JoshLoecker commented 2 years ago

Nevermind, I see now there is a plugins directory already located under the /data/plugins folder, which I have mounted at ./config. I will use that folder instead of mounting my own

itzg commented 2 years ago

Your suggestion is actually what I would recommend

./config:/data
./plugins:/plugins
github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Please add a comment describing the reason to keep this issue open.