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.55k stars 1.56k forks source link

Error thrown when using docker-compose-forge-bettermcplus #2494

Closed pookieman closed 1 year ago

pookieman commented 1 year ago

Describe the problem

Trying to use https://github.com/itzg/docker-minecraft-server/blame/master/examples/docker-compose-forge-bettermcplus

in portainer - running on ubuntu

logs around the error look like this (I've got debug enabled)

+ exec mc-server-runner --stop-duration 60s --named-pipe /tmp/minecraft-console-in --shell bash ./run.sh
Error: Could not find or load main class @user_jvm_args.txt
2023-11-14T22:13:48.392-0800    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}
2023-11-14T22:13:48.393-0800    INFO    mc-server-runner    Done
+ export HOME=/data

I can see the file it's complaining about in the data directory which is mounted

@portainer:~/GameData/data$ cat user_jvm_args.txt
-Xmx8G -Xms8G -Dlog4j.configurationFile=/data/log4j2.xml

and if I look for arg files

@portainer:~/GameData/data$ ls -l libraries/net/minecraftforge/forge/1.20.1-47.2.4/*.txt
-rw-rw-r-- 1 jinder root 5169 Nov 14 21:40 libraries/net/minecraftforge/forge/1.20.1-47.2.4/unix_args.txt
-rw-rw-r-- 1 jinder root 5169 Nov 14 21:40 libraries/net/minecraftforge/forge/1.20.1-47.2.4/win_args.txt

Container definition

version: '3.8'

####################################################################
#                       FORGE_GENERIC_PACK                         #
#                                                                  #
# Date: 20221005                                                   #
#                                                                  #
# Mod: Better Minecraft Plus v40                                   #
#                                                                  #
# Game Version: 1.16.5                                             #
#                                                                  #
# Notes: Verify that there is no EULA file in the modpack.zip      #
#        if you do not delete it the EULA flag below will be       #
#        overwritten when the modpack is copied.                   #
#                                                                  #
####################################################################
services:

####################################################################
#                         Service Name                             #
#                                                                  #
# Define Service Name here. If using RCON this name will be        #
# referenced again as RWA_RCON_HOST below.                         #
#                                                                  #
# Example: 'name:' or 'mc_atm6:'                                   #
####################################################################
  mc_bmp:

####################################################################
#                      Image & Container Name                      #
#                                                                  #
# Specify Image Name and Java Version. The 'image' will always be  #
# 'itzg/minecraft-server' however the tag added to the end is      #
# where you can specify the java version or container architecture.#
# See readme.md for a full list.                                   #
#                                                                  #
# 'container_name:' This can be anything you like. This is the name#
# that will show when you run 'docker ps' commands.                #
####################################################################
    image: itzg/minecraft-server:java8
    container_name: mc_bmp

####################################################################
#                         Server Ports                             #
#                                                                  #
# Specify external port.                                           #
####################################################################
    ports:
      - 25565:25565

####################################################################
#                   Automatic Server Restart                       #
#                                                                  #
# Define a restart policy here.                                    #
#    - 'no' = Do not restart.                                      #
#    - 'on-failure' = Restart if container exits because an error. #
#    - 'always' = Regardless of stop reason.                       #
#    - 'unless-stopped' = Similar to always except if stopped.     #
####################################################################
    restart: unless-stopped

####################################################################
#                             EULA                                 #
#                                                                  #
# Accept EULA by setting to "true"                                 #
####################################################################
    environment:
      EULA: "true"

####################################################################
#                          FORGE INSTALL                           #
#                                                                  #
# Sets install type to FORGE and specifys the zip folder name      #
# and location of your mod pack.                                   #
#                                                                  #
# TYPE: Defines the install type as FORGE                          #
#                                                                  #
# VERSION: Defines the version of MC the modpack is based on.      #
#                                                                  #
# FORGE_VERSION: Defines the version of FORGE the modpack uses.     #
#               This can usually be found in the modpack.zip as    #
#               installer.jar                                      #
#                                                                  #
# GENERIC_PACK: Define where the modpack.zip is located.           #
#                                                                  #
# Place your mod zip file in a folder called 'modpacks' in the     #
# same directory you place this docker-compose file.               #
####################################################################
      TYPE: FORGE
      VERSION: 1.20.1
      FORGE_VERSION: 47.2.4
      GENERIC_PACK: /modpacks/BMC4_FORGE_1.20.1_Server_Pack_v20.zip

####################################################################
#                          Server Memory                           #
#                                                                  #
# Set Maximum amount of memory allowed for your server.            #
####################################################################
      MEMORY: "8G"

####################################################################
#                         Logging Options                          #
#                                                                  #
# Set to "true" to delete old logs                                 #
####################################################################
      ENABLE_ROLLING_LOGS: "true"

####################################################################
#                          Server Timezone                         #
#                                                                  #
# Specify server Timezone                                          #
####################################################################
      TZ: "America/Vancouver"

####################################################################
#                       Minecraft Game Options                     #
#                                                                  #
# List any game options you want to define here. A full list can   #
# be found on the readme.md page on github.                        #
####################################################################
      OVERRIDE_SERVER_PROPERTIES: "true"
      DIFFICULTY: "easy"
      MAX_TICK_TIME: "-1"
      ALLOW_FLIGHT: "true"
      OPS: ""
      VIEW_DISTANCE: 10
      MAX_PLAYERS: 10
      PVP: "false"
      LEVEL_TYPE: "biomesoplenty"
      MOTD: "Welcome Home"

Container logs

No response

itzg commented 1 year ago

Forge 1.20 needs Java 17 or newer, not 8. Remove the image tag ":java8" to get the latest (which is Java 17) or use use one of the appropriate image tags from https://docker-minecraft-server.readthedocs.io/en/latest/versions/java/

pookieman commented 1 year ago

Thank you .. this is a case of rushing to help my teenager without reading all the docs.. appreciate it.