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

2022-07-21T22:16:56.506Z WARN mc-server-runner Minecraft server process failed {"exitCode": 2} when trying to start a Better Minecraft Forge server #1620

Closed ghost closed 2 years ago

ghost commented 2 years ago

Describe the problem

I have been trying to start a curseforge server and using Better MC 1.18.2 (Forge) server pack to run it but everytime I try to run it I run into this error message

2022-07-21T22:16:56.506Z WARN mc-server-runner Minecraft server process failed {"exitCode": 2}

Here is the link to the said modpack: https://www.curseforge.com/minecraft/modpacks/better-mc-modpack-new

Docker Logs (I replaced names with dots besides my own or privacy):

[init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 1 1000 1000 84 Jul 21 22:16 /data'
[init] Resolved version given LATEST into 1.19 and major version 1.19
[init] Resolving type given CURSEFORGE
[init] Looking for Feed-The-Beast / CurseForge server modpack.
[init] detected FTB, changing properties path to /data/FeedTheBeast/Better MC Server Pack [FORGE] 1.18/server.properties
[init] server.properties already created, skipping
[init] Updating ops
[init] FurtherSaltz already present in ops.json, skipping
[init] Updating whitelist
[init] . already present in whitelist.json, skipping
[init] . already present in whitelist.json, skipping
[init] . already present in whitelist.json, skipping
[init] . already present in whitelist.json, skipping
[init] FurtherSaltz already present in whitelist.json, skipping
[init] Checking for JSON files.
[init] Setting initial memory to 4G and max to 4G
[init] Running FTB /data/FeedTheBeast/Better MC Server Pack [FORGE] 1.18/start.sh in /data/FeedTheBeast/Better MC Server Pack [FORGE] 1.18 ...
/data/FeedTheBeast/Better MC Server Pack [FORGE] 1.18/start.sh: line 106: unexpected EOF while looking for matching `"'
/data/FeedTheBeast/Better MC Server Pack [FORGE] 1.18/start.sh: line 107: syntax error: unexpected end of file
2022-07-21T22:21:57.885Z    WARN    mc-server-runner    Minecraft server process failed {"exitCode": 2}
2022-07-21T22:21:57.885Z    INFO    mc-server-runner    Done

Docker-compose file (I replaced names with dots besides my own or privacy) :


version: "3"

services:
  mc:
    image: itzg/minecraft-server
    ports:
      - 5271:25565
    environment:
      EULA: "TRUE"
      MEMORY: "4G"
      TYPE: "CURSEFORGE"  
      WHITELIST: .,.,.,.,.,FurtherSaltz,.
      ENABLE_WHITELIST: "true"
      OPS: FurtherSaltz
      CF_SERVER_MOD: /modpacks/Better+MC+Server+Pack+[FORGE]+v14.zip
    tty: true
    stdin_open: true
    restart: unless-stopped
    volumes:
      - ./minecraft-data:/data
      - ./modpacks:/modpacks
    container_name: "mineserver"

Container definition

Paste run command or compose file here

Container logs

Paste logs here
itzg commented 2 years ago

Sorry for the huge delay in getting to this. Some modpacks have random or incompatible issues. Instead try this for the environment replacing TYPE and CF_SERVER_MOD:

      TYPE: FORGE
      VERSION: 1.18.2
      FORGEVERSION: 40.1.68
      GENERIC_PACK: /modpacks/Better+MC+Server+Pack+[FORGE]+v14.zip
merryfistmas commented 2 years ago

I am running into a similar problem using the same modpack. The console output is as follows.

[+] Running 1/1
 - Container BetterMC-server  Recreated                                                                                                                                                                                                                         0.1s
Attaching to BetterMC-server
BetterMC-server  | [init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 9 1000 1000 4096 Sep  7 07:59 /data'
BetterMC-server  | [init] Resolved version given 1.18.2 into 1.18.2 and major version 1.18
BetterMC-server  | [init] Resolving type given FORGE
BetterMC-server  | [init] Checking Forge version information.
BetterMC-server  | [init] Checking if generic packs are up to date       
BetterMC-server  | [init] Generic pack(s) are out of date. Re-applying...
BetterMC-server  | [init] Manifest exists from older generic pack, cleaning up ...
BetterMC-server  | [init] Writing generic pack manifest ...
BetterMC-server  | [init] Applying generic pack ...
BetterMC-server  | [init] Saving generic pack(s) checksum
BetterMC-server exited with code 1
BetterMC-server  | [init] Resolved version given 1.18.2 into 1.18.2 and major version 1.18
BetterMC-server  | [init] Resolving type given FORGE
Gracefully stopping... (press Ctrl+C again to force)
[+] Running 1/1
 - Container BetterMC-server  Stopped                                                                                                                                                                                                                          11.2s 
canceled
PS C:\Users\dwill\projects\Minecraft_Server\forge_minecraft>

I also tried using the "java8-jdk" tag as I read forge doesn't work with latest sometimes (although my version should be new enough) and got this output instead.

[+] Running 1/0
 - Container BetterMC-server  Recreated                                                                                                                                                                                                                         0.1s 
Attaching to BetterMC-server
BetterMC-server  | [init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 9 1000 1000 4096 Sep  7 08:03 /data'
BetterMC-server  | [init] Resolved version given 1.18.2 into 1.18.2 and major version 1.18
BetterMC-server  | [init] Resolving type given FORGE
BetterMC-server  | [mc-image-helper] 08:06:08.827 INFO  : Removing previously installed files due to version change from MC 1.19.2/Forge 43.1.1 to MC 1.18.2/Forge 40.1.68
BetterMC-server  | [mc-image-helper] 08:06:08.847 INFO  : Downloading Forge installer 40.1.68 for Minecraft 1.18.2
BetterMC-server  | [mc-image-helper] 08:06:12.654 INFO  : Running Forge installer. This might take a while...
BetterMC-server  | [init] Removing old mods including:*.jar,*-version.json excluding:
BetterMC-server  | [init] Checking if generic packs are up to date
BetterMC-server  | [init] Generic pack(s) are out of date. Re-applying...
BetterMC-server  | [init] Manifest exists from older generic pack, cleaning up ...
BetterMC-server  | [init] Writing generic pack manifest ... 
BetterMC-server  | [init] Applying generic pack ...
BetterMC-server  | [init] Saving generic pack(s) checksum
BetterMC-server  | [init] server.properties already created, skipping
BetterMC-server  | [init] Updating ops
BetterMC-server  | [init] merryfistmas already present in ops.json, skipping
BetterMC-server  | [init] Checking for JSON files.
BetterMC-server  | [init] Setting initial memory to 1G and max to 8G
BetterMC-server  | [init] Using Forge supplied run.sh script...
BetterMC-server  | Error: Could not find or load main class @user_jvm_args.txt
BetterMC-server  | 2022-09-07T08:06:48.103Z     WARN    mc-server-runner        Minecraft server process failed {"exitCode": 1}
BetterMC-server  | 2022-09-07T08:06:48.103Z     INFO    mc-server-runner        Done
BetterMC-server exited with code 1
BetterMC-server  | [init] Resolved version given 1.18.2 into 1.18.2 and major version 1.18
Gracefully stopping... (press Ctrl+C again to force)
[+] Running 1/1
 - Container BetterMC-server  Stopped                                                                                                                                                                                                                          11.1s 
canceled

This line Error: Could not find or load main class @user_jvm_args.txt appears to be the problem, however a file with this name generated in my docker volume. The contents of the file is: -Xmx8G -Xms1G

This is my docker-compose.yml

version: "3.8"

services:
  minecraft:
    image: itzg/minecraft-server:latest
    #image: itzg/minecraft-server:java8-jdk
    volumes:
      - radminecraftdata:/data
      - .\extras:/extras
    container_name: BetterMC-server
    ports:
      - 25556:25566
    environment:
      OPS: merryfistmas
      SERVER_NAME: "Dockerized-Minecraft-Server"
      MOTD: "Better MC Server"
      EULA: "TRUE"
      #VERSION: "1.19.2"
      #TYPE: "CURSEFORGE"
      #CF_SERVER_MOD: /extras/BetterMC_ServerPack_FORGE_1.16.5_v58.5.zip
      TYPE: FORGE
      VERSION: 1.18.2
      FORGEVERSION: 40.1.68
      GENERIC_PACK: /extras/BetterMC_ServerPack_FORGE_1.16.5_v58.5.zip
      MODE: "survival"
      INIT_MEMORY: 1G
      MAX_MEMORY: 8G
      LEVEL_TYPE: "DEFAULT"
      DIFFICULTY: "hard"
      VIEW_DISTANCE: "24"
      ENABLE_RCON: "true"
      RCON_PASSWORD: password
      RCON_PORT: 25576
      SERVER_PORT: 25566
      ENABLE_WHITELIST: "true"
      ENFORCE_WHITELIST: "true"
      MAX_PLAYERS: 20
      ANNOUNCE_PLAYER_ACHIEVEMENTS: "true"
      SPAWN_ANIMALS: "true"
      SPAWN_MONSTERS: "true"
      PVP: "true"
      GUI: "FALSE"
      REMOVE_OLD_MODS: "true"
    stdin_open: true
    tty: true
    restart: unless-stopped
volumes:
  radminecraftdata:
    external: true
  data: {}

The commented lines are other variables I've tried to get it to work. I have also tried the RAD server mod as well and it gives me the same error codes so I'm not convinced it's the fault of the mod. Do you know what the problem could be?

itzg commented 2 years ago

Make sure to pull the latest image. An issue in that exact spot was fixed recently.

Also, you can't use Java 8 with Minecraft 1.18+, which is why you saw the other error.

merryfistmas commented 2 years ago

I got it working. I looked at run.sh and changed the minecraft and forge versions to match it. The mod page in curseforge also tells you what version to use, so it turns out I just needed to read the mod page. I did have to use java8-jdk. I'll leave my docker-compose.yml here in case anyone else runs into a similar problem.

version: "3.8"

services:
  minecraft:
    image: itzg/minecraft-server:java8-jdk

    volumes:
      - BetterMCdata:/data
      - .\extras:/extras
    container_name: BetterMC-server
    ports:
      - 25566:25566
    environment:
      OPS: merryfistmas
      SERVER_NAME: "Dockerized-Minecraft-Server"
      MOTD: "Better MC Server"
      EULA: "TRUE"
      VERSION: 1.16.5
      FORGEVERSION: 36.2.39
      TYPE: FORGE
      GENERIC_PACK: /extras/BetterMC_ServerPack_FORGE_1.16.5_v58.5.zip
      MODE: "survival"
      INIT_MEMORY: 1G
      MAX_MEMORY: 8G
      LEVEL_TYPE: "DEFAULT"
      DIFFICULTY: "hard"
      VIEW_DISTANCE: "24"
      ENABLE_RCON: "true"
      RCON_PASSWORD: password
      RCON_PORT: 25576
      SERVER_PORT: 25566
      ENABLE_WHITELIST: "true"
      ENFORCE_WHITELIST: "true"
      MAX_PLAYERS: 20
      ANNOUNCE_PLAYER_ACHIEVEMENTS: "true"
      SPAWN_ANIMALS: "true"
      SPAWN_MONSTERS: "true"
      PVP: "true"
      GUI: "FALSE"
      REMOVE_OLD_MODS: "true"
    stdin_open: true
    tty: true
    restart: unless-stopped
volumes:
  BetterMCdata:
    external: true
  data: {}
itzg commented 2 years ago

Resolved by #1762