itzg / minecraft-server-charts

MIT License
279 stars 144 forks source link

Server will not start due to Java runtime version mismatch #231

Closed pckroon closed 2 months ago

pckroon commented 2 months ago

Hello world, I'm having issues deploying my minecraft server. The pod crashes with the following logs:

[init] Running as uid=1000 gid=3000 with /data as 'drwxrwsr-x 7 0 2000 319 Sep 18 09:01 /data'
[init] Resolving type given VANILLA
[init] Resolved version given LATEST into 1.21.1
[init] Setting mode
[init] Setting initial memory to 1024M and max to 1024M
[init] Starting the Minecraft server...
Error: LinkageError occurred while loading main class net.minecraft.bundler.Main
        java.lang.UnsupportedClassVersionError: net/minecraft/bundler/Main has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0
2024-09-18T09:01:42.753Z        WARN    mc-server-runner        Minecraft server failed. Inspect logs above for errors that indicate cause. DO NOT report this line as an error.    {"exitCode": 1}
2024-09-18T09:01:42.753Z        INFO    mc-server-runner        Done

helm list

NAME            NAMESPACE       REVISION        UPDATED                                         STATUS          CHART               APP VERSION
minecraft       minecraft       3               2024-09-18 10:54:06.251903447 +0200 CEST        deployed        minecraft-4.23.1    SeeValues  

values.yaml

minecraftServer:
  eula: TRUE
  onlineMode: false
  overrideServerProperties: true
  difficulty: 'normal'
  serviceType: LoadBalancer

  rcon:
    enabled: true
    password: ...
    serviceType: LoadBalancer

persistence:
  storageClass: null  # Default SC
  dataDir:
    enabled: true
    Size: 5Gi

service:
  type: LoadBalancer

rconWeb:
  isAdmin: true
  username: admin
  password: ...
  serverName: ...
  rconHost: minecraft-minecraft-rcon.minecraft.svc.cluster.local
  websocketRcon: false

Any help would be much appreciated :)

pckroon commented 2 months ago

I added extraEnv.DEBUG: true, here's the debug logs.

Debug logs ``` + export HOME=/data + HOME=/data ++ id -u ++ id -g ++ ls -lnd /data + log 'Running as uid=1000 gid=3000 with /data as '\''drwxrwsr-x 7 0 2000 319 Sep 18 09:20 /data'\''' + local oldState ++ shopt -po xtrace + oldState='set -o xtrace' + shopt -u -o xtrace [init] 2024-09-18 09:20:33+00:00 Running as uid=1000 gid=3000 with /data as 'drwxrwsr-x 7 0 2000 319 Sep 18 09:20 /data' + '[' '!' -e /data/eula.txt ']' + isTrue false + case "${1,,}" in + return 1 + isTrue true + case "${1,,}" in + return 0 + [[ -v RCON_PASSWORD_FILE ]] + [[ -v RCON_PASSWORD ]] + echo 'password=...' + echo 'password: "..."' + isTrue false + case "${1,,}" in + return 1 + isTrue false + case "${1,,}" in + return 1 + [[ -n '' ]] + fixJavaPath + which java + cd /data + export DECLARED_TYPE=VANILLA + DECLARED_TYPE=VANILLA + export DECLARED_VERSION=LATEST + DECLARED_VERSION=LATEST + isTrue false + case "${1,,}" in + return 1 + isTrue false + case "${1,,}" in + return 1 + [[ -n '' ]] + [[ -n '' ]] + [[ -n '' ]] + [[ -n '' ]] + [[ -n '' ]] + : '' + case "${TYPE^^}" in + [[ -n '' ]] + log 'Resolving type given VANILLA' + local oldState ++ shopt -po xtrace + oldState='set -o xtrace' + shopt -u -o xtrace [init] 2024-09-18 09:20:33+00:00 Resolving type given VANILLA + case "${TYPE^^}" in + exec /start-deployVanilla + set -o pipefail + resolveVersion + givenVersion=LATEST ++ mc-image-helper resolve-minecraft-version LATEST [mc-image-helper] 09:20:35.027 DEBUG : JSON FETCH: uri=https://launchermeta.mojang.com/mc/game/version_manifest_v2.json headers=[user-agent: itzg/mc-image-helper/1.38.7 (cmd=resolve-minecraft-version), x-fetch-session: 8b0c652d-6b2d-4ef1-98b5-b73348659451, accept: application/json, host: launchermeta.mojang.com] [mc-image-helper] 09:20:35.144 DEBUG : Resolved given Minecraft version LATEST to 1.21.1 + VERSION=1.21.1 + log 'Resolved version given LATEST into 1.21.1' + local oldState ++ shopt -po xtrace + oldState='set -o xtrace' + shopt -u -o xtrace [init] 2024-09-18 09:20:35+00:00 Resolved version given LATEST into 1.21.1 + export SERVER=minecraft_server.1.21.1.jar + SERVER=minecraft_server.1.21.1.jar + '[' '!' -e minecraft_server.1.21.1.jar ']' + '[' -n '' ']' + versionLessThan 1.6 + mc-image-helper compare-versions 1.21.1 lt 1.6 + return 1 + [[ -L /data/minecraft_server.jar ]] + isDebugging + isTrue true + case "${1,,}" in + return 0 + return 0 + ls -l total 100864 -rw-rw-r-- 1 minecraft 2000 2 Jul 16 12:28 banned-ips.json -rw-rw-r-- 1 minecraft 2000 2 Jul 16 12:28 banned-players.json -rw-rw-r-- 1 minecraft 2000 68 Jul 15 13:36 eula.txt drwxrwsr-x 8 minecraft 2000 77 Jul 16 12:27 libraries drwxrwsr-x 2 minecraft 2000 24 Jul 16 12:27 logs -rw-rw-r-- 1 minecraft 2000 51627615 Sep 18 08:54 minecraft_server.1.21.1.jar -rw-rw-r-- 1 minecraft 2000 51623779 Jul 15 13:36 minecraft_server.1.21.jar -rw-rw-r-- 1 minecraft 2000 2 Jul 16 12:28 ops.json -rw-rw-r-- 1 minecraft 2000 1417 Sep 18 09:20 server.properties -rw-rw-r-- 1 minecraft 2000 2 Jul 16 12:28 usercache.json drwxrwsr-x 3 minecraft 2000 18 Jul 16 12:27 versions -rw-rw-r-- 1 minecraft 2000 2 Jul 16 12:28 whitelist.json drwxrwsr-x 10 minecraft 2000 177 Jul 16 13:13 world + export FAMILY=VANILLA + FAMILY=VANILLA + exec /start-setupWorld + '[' VANILLA = CURSEFORGE ']' + worldDest=/data/world + [[ -n '' ]] + exec /start-setupDatapack + out_dir=/data/world/datapacks + isTrue false + case "${1,,}" in + return 1 + [[ -n '' ]] + [[ -n '' ]] + [[ -n '' ]] + [[ -n '' ]] + exec /start-setupModpack + CURSE_URL_BASE=https://minecraft.curseforge.com/projects + isTrue false + case "${1,,}" in + return 1 + handlePackwiz + [[ -n '' ]] + handleModpackZip + [[ -n '' ]] + handleListings + usesMods + case "$FAMILY" in + return 1 + usesPlugins + case "$FAMILY" in + return 1 + usesMods + case "$FAMILY" in + return 1 + [[ -n '' ]] + [[ -n '' ]] + [[ -n '' ]] + [[ -n '' ]] + handleGenericPacks + : '' + : '' + : '' + [[ -n '' ]] + handleModrinthProjects + : '' + : release + : none + [[ -v MODRINTH_DOWNLOAD_OPTIONAL_DEPENDENCIES ]] + [[ -n '' ]] + usesMods + case "$FAMILY" in + return 1 + usesPlugins + case "$FAMILY" in + return 1 + [[ -n '' ]] + exec /start-setupMounts + isTrue true + case "${1,,}" in + return 0 + updateArg=--skip-newer-in-destination + isTrue true + case "${1,,}" in + return 0 + subcommand=sync-and-interpolate + : /plugins + : /data/plugins + usesPlugins + case "$FAMILY" in + return 1 + : /mods + : /data/mods + usesMods + case "$FAMILY" in + return 1 + : /config + : /data/config + '[' -d /config ']' + exec /start-setupServerProperties [init] 2024-09-18 09:20:36+00:00 Setting mode + mc-image-helper set-properties --definitions /image/property-definitions.json /data/server.properties + isTrue '' + case "${1,,}" in + return 1 + isTrue false + case "${1,,}" in + return 1 + exec /start-setupEnvVariables + [[ -v APPEND_OPS ]] + [[ -v OVERRIDE_OPS ]] + [[ -v APPEND_WHITELIST ]] + [[ -v OVERRIDE_WHITELIST ]] + sharedArgs=(--version="$VERSION") + [[ -n '' ]] + sharedArgs+=(--output-directory=/data) + [[ -v OPS_FILE ]] + [[ -v OPS ]] + [[ -v WHITELIST_FILE ]] + [[ -v WHITELIST ]] + exec /start-finalExec + '[' -n '' ']' + canUseRollingLogs=true + useFallbackJvmFlag=false + [[ -n '' ]] + SERVER_DIR=/data + versionLessThan 1.7 + mc-image-helper compare-versions 1.21.1 lt 1.7 + return 1 + isFamily VANILLA + for f in "${@}" + [[ VANILLA == \V\A\N\I\L\L\A ]] + return 0 + versionLessThan 1.12 + mc-image-helper compare-versions 1.21.1 lt 1.12 + return 1 + isFamily VANILLA + for f in "${@}" + [[ VANILLA == \V\A\N\I\L\L\A ]] + return 0 + versionLessThan 1.17 + mc-image-helper compare-versions 1.21.1 lt 1.17 + return 1 + isType PURPUR + for t in "${@}" + [[ VANILLA == \P\U\R\P\U\R ]] + return 1 + isType PURPUR + for t in "${@}" + [[ VANILLA == \P\U\R\P\U\R ]] + return 1 + versionLessThan 1.18.1 + mc-image-helper compare-versions 1.21.1 lt 1.18.1 + return 1 + false + versionLessThan 1.7 + mc-image-helper compare-versions 1.21.1 lt 1.7 + return 1 + versionLessThan 1.18.1 + mc-image-helper compare-versions 1.21.1 lt 1.18.1 + return 1 + isTrue false + case "${1,,}" in + return 1 + versionLessThan 1.14 + mc-image-helper compare-versions 1.21.1 lt 1.14 + return 1 + [[ '' = false ]] + expandedDOpts= + '[' -n '' ']' + isTrue '' + case "${1,,}" in + return 1 + isTrue '' + case "${1,,}" in + return 1 + isTrue '' + case "${1,,}" in + return 1 + isTrue '' + case "${1,,}" in + return 1 + [[ -n 1024M ]] + log 'Setting initial memory to 1024M and max to 1024M' + local oldState ++ shopt -po xtrace + oldState='set -o xtrace' + shopt -u -o xtrace [init] 2024-09-18 09:20:45+00:00 Setting initial memory to 1024M and max to 1024M + [[ -n 1024M ]] + JVM_OPTS='-Xms1024M ' + [[ -n 1024M ]] + JVM_OPTS='-Xmx1024M -Xms1024M ' + versionLessThan b1.8 + mc-image-helper compare-versions 1.21.1 lt b1.8 + return 1 + versionLessThan 1.7 + mc-image-helper compare-versions 1.21.1 lt 1.7 + return 1 + rm -f /data/.mc-health.env + mcServerRunnerArgs=(--stop-duration "${STOP_DURATION:-60}s") + isTrue false + case "${1,,}" in + return 1 + [[ -n '' ]] + isTrue '' + case "${1,,}" in + return 1 + [[ VANILLA == \C\U\R\S\E\F\O\R\G\E ]] + [[ VANILLA == \C\U\R\S\E\F\O\R\G\E ]] + [[ minecraft_server.1.21.1.jar =~ run.sh ]] + '[' -f /data/bootstrap.txt ']' + log 'Starting the Minecraft server...' + local oldState ++ shopt -po xtrace + oldState='set -o xtrace' + shopt -u -o xtrace [init] 2024-09-18 09:20:47+00:00 Starting the Minecraft server... + finalArgs=($JVM_XX_OPTS $JVM_OPTS $expandedDOpts) + [[ -n '' ]] + finalArgs+=(-jar "$SERVER") + finalArgs+=("$@" $EXTRA_ARGS) + isTrue false + case "${1,,}" in + return 1 + isTrue false + case "${1,,}" in + return 1 + isTrue false + case "${1,,}" in + return 1 + exec mc-server-runner --stop-duration 60s java -Xmx1024M -Xms1024M -jar minecraft_server.1.21.1.jar Error: LinkageError occurred while loading main class net.minecraft.bundler.Main java.lang.UnsupportedClassVersionError: net/minecraft/bundler/Main has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0 2024-09-18T09:20:47.354Z WARN mc-server-runner Minecraft server failed. Inspect logs above for errors that indicate cause. DO NOT report this line as an error. {"exitCode": 1} 2024-09-18T09:20:47.354Z INFO mc-server-runner Done ```
itzg commented 2 months ago

https://docker-minecraft-server.readthedocs.io/en/latest/versions/java/

pckroon commented 2 months ago

Thanks for the hint. I've updated the pullPolicy to always.