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.32k stars 1.53k forks source link

Can't get fabric to use the main version #1192

Closed Coding-Kiwi closed 2 years ago

Coding-Kiwi commented 2 years ago

Describe the problem

I did not configure the VERSION variable, so the server started with version 1.18 then I restarted the server, meanwhile 1.18.1 was released so the server automatically uses 1.18.1, sadly some fabric mods are not yet compatible. So I changed the VERSION to 1.18

The server log correctly says

[init] Resolved version given 1.18 into 1.18

but it then continues to use the subversion

[INFO] [FabricLoader/GameProvider]: Loading for game Minecraft 1.18.1
[main/INFO]: Loading for game Minecraft 1.18.1

1.18.0 does not work

Container definition

minecraft:
    image: itzg/minecraft-server
    restart: unless-stopped
    ports:
      - "25565:25565"
      - "24454:24454/udp"  
    volumes:
      - /etc/minecraft/cavesandcliffs:/data
    environment:
      TYPE: "FABRIC"
      EULA: "TRUE"
      CONSOLE: "FALSE"
      MAX_MEMORY: "5G"
      JVM_OPTS: "-Dlog4j2.formatMsgNoLookups=true"
      VERSION: "1.18"

Container logs

minecraft_1         | [init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 10 1000 1000 4096 Dec 12 17:56 /data'
minecraft_1         | [init] Resolved version given 1.18 into 1.18
minecraft_1         | [init] Resolving type given FABRIC
minecraft_1         | [init] server.properties already created, skipping
minecraft_1         | [init] Checking for JSON files.
minecraft_1         | [init] Setting initial memory to 1G and max to 5G
minecraft_1         | [init] Starting the Minecraft server...
minecraft_1         | Starting net.fabricmc.loader.impl.game.minecraft.BundlerClassPathCapture
minecraft_1         | [19:03:07] [INFO] [FabricLoader/GameProvider]: Loading for game Minecraft 1.18.1
minecraft_1         | [19:03:08] [main/INFO]: Loading for game Minecraft 1.18.1
minecraft_1         | [19:03:08] [main/WARN]: Mod resolution failed
minecraft_1         | [19:03:08] [main/INFO]: Immediate reason: [HARD_DEP_INCOMPATIBLE_PRESELECTED voicechat 1.18-2.1.17 {depends minecraft @ [1.18]}, ROOT_FORCELOAD_SINGLE voicechat 1.18-2.1.17]
minecraft_1         | [19:03:08] [main/INFO]: Reason: [HARD_DEP voicechat 1.18-2.1.17 {depends minecraft @ [1.18]}]
minecraft_1         | [19:03:08] [main/INFO]: SERVER environment disabled: [fabric-renderer-api-v1, fabric-keybindings-v0, fabric-renderer-registries-v1, fabric-textures-v0, fabric-models-v0, fabric-screen-api-v1, fabric-rendering-v0, fabric-rendering-v1, fabric-key-binding-api-v1, fabric-renderer-indigo, fabric-blockrenderlayer-v1]
minecraft_1         | [19:03:08] [main/INFO]: Fix: add [], remove [], replace [[minecraft 1.18.1] -> add:minecraft 1.18 ([[1.18,1.18]])]
minecraft_1         | [19:03:08] [main/ERROR]: Incompatible mod set!
minecraft_1         | net.fabricmc.loader.impl.FormattedException: net.fabricmc.loader.impl.discovery.ModResolutionException: Mod resolution encountered an incompatible mod set!
minecraft_1         | A potential solution has been determined:
minecraft_1         |    - Replace 'Minecraft' (minecraft) 1.18.1 with version 1.18.
minecraft_1         | Unmet dependency listing:
minecraft_1         |    - Mod 'Simple Voice Chat' (voicechat) 1.18-2.1.17 requires version 1.18 of 'Minecraft' (minecraft), but only the wrong version is present: 1.18.1!
minecraft_1         |            - 'Minecraft' (minecraft) 1.18.1 is an environment reference and usually requires installation or launcher changes to adjust
minecraft_1         | Inactive mods:
minecraft_1         |    - 'Minecraft' (minecraft) 1.18.1, reason: to replace
minecraft_1         |    - mod 'Fabric BlockRenderLayer Registration (v1)' (fabric-blockrenderlayer-v1) 1.1.9+3ac43d95c8, reason: wrong environment (client/server only)
minecraft_1         |    - mod 'Fabric Key Binding API (v1)' (fabric-key-binding-api-v1) 1.0.8+c8aba2f3c8, reason: wrong environment (client/server only)
minecraft_1         |    - mod 'Fabric Key Bindings (v0)' (fabric-keybindings-v0) 0.2.6+b4f4f6cdc8, reason: wrong environment (client/server only)
minecraft_1         |    - mod 'Fabric Models (v0)' (fabric-models-v0) 0.3.3+3ac43d95c8, reason: wrong environment (client/server only)
minecraft_1         |    - mod 'Fabric Renderer API (v1)' (fabric-renderer-api-v1) 0.4.9+3ac43d95c8, reason: wrong environment (client/server only)
minecraft_1         |    - mod 'Fabric Renderer - Indigo' (fabric-renderer-indigo) 0.4.12+3ac43d95c8, reason: wrong environment (client/server only)
minecraft_1         |    - mod 'Fabric Renderer Registries (v1)' (fabric-renderer-registries-v1) 3.2.7+b4f4f6cdc8, reason: wrong environment (client/server only)
minecraft_1         |    - mod 'Fabric Rendering (v0)' (fabric-rendering-v0) 1.1.9+b4f4f6cdc8, reason: wrong environment (client/server only)
minecraft_1         |    - mod 'Fabric Rendering (v1)' (fabric-rendering-v1) 1.10.3+6b21378ac8, reason: wrong environment (client/server only)
minecraft_1         |    - mod 'Fabric Screen API (v1)' (fabric-screen-api-v1) 1.0.7+3ac43d95c8, reason: wrong environment (client/server only)
minecraft_1         |    - mod 'Fabric Textures (v0)' (fabric-textures-v0) 1.0.9+3ac43d95c8, reason: wrong environment (client/server only)
minecraft_1         |   at net.fabricmc.loader.impl.FabricLoaderImpl.load(FabricLoaderImpl.java:188) ~[fabric-loader-0.12.8.jar:?]
minecraft_1         |   at net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:142) ~[fabric-loader-0.12.8.jar:?]
minecraft_1         |   at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:71) [fabric-loader-0.12.8.jar:?]
minecraft_1         |   at net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23) [fabric-loader-0.12.8.jar:?]
minecraft_1         |   at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
minecraft_1         |   at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
minecraft_1         |   at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
minecraft_1         |   at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
minecraft_1         |   at net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:66) [fabric-loader-0.12.8.jar:?]
minecraft_1         | Caused by: net.fabricmc.loader.impl.discovery.ModResolutionException: Mod resolution encountered an incompatible mod set!
minecraft_1         | A potential solution has been determined:
minecraft_1         |    - Replace 'Minecraft' (minecraft) 1.18.1 with version 1.18.
minecraft_1         | Unmet dependency listing:
minecraft_1         |    - Mod 'Simple Voice Chat' (voicechat) 1.18-2.1.17 requires version 1.18 of 'Minecraft' (minecraft), but only the wrong version is present: 1.18.1!
minecraft_1         |            - 'Minecraft' (minecraft) 1.18.1 is an environment reference and usually requires installation or launcher changes to adjust
minecraft_1         | Inactive mods:
minecraft_1         |    - 'Minecraft' (minecraft) 1.18.1, reason: to replace
minecraft_1         |    - mod 'Fabric BlockRenderLayer Registration (v1)' (fabric-blockrenderlayer-v1) 1.1.9+3ac43d95c8, reason: wrong environment (client/server only)
minecraft_1         |    - mod 'Fabric Key Binding API (v1)' (fabric-key-binding-api-v1) 1.0.8+c8aba2f3c8, reason: wrong environment (client/server only)
minecraft_1         |    - mod 'Fabric Key Bindings (v0)' (fabric-keybindings-v0) 0.2.6+b4f4f6cdc8, reason: wrong environment (client/server only)
minecraft_1         |    - mod 'Fabric Models (v0)' (fabric-models-v0) 0.3.3+3ac43d95c8, reason: wrong environment (client/server only)
minecraft_1         |    - mod 'Fabric Renderer API (v1)' (fabric-renderer-api-v1) 0.4.9+3ac43d95c8, reason: wrong environment (client/server only)
minecraft_1         |    - mod 'Fabric Renderer - Indigo' (fabric-renderer-indigo) 0.4.12+3ac43d95c8, reason: wrong environment (client/server only)
minecraft_1         |    - mod 'Fabric Renderer Registries (v1)' (fabric-renderer-registries-v1) 3.2.7+b4f4f6cdc8, reason: wrong environment (client/server only)
minecraft_1         |    - mod 'Fabric Rendering (v0)' (fabric-rendering-v0) 1.1.9+b4f4f6cdc8, reason: wrong environment (client/server only)
minecraft_1         |    - mod 'Fabric Rendering (v1)' (fabric-rendering-v1) 1.10.3+6b21378ac8, reason: wrong environment (client/server only)
minecraft_1         |    - mod 'Fabric Screen API (v1)' (fabric-screen-api-v1) 1.0.7+3ac43d95c8, reason: wrong environment (client/server only)
minecraft_1         |    - mod 'Fabric Textures (v0)' (fabric-textures-v0) 1.0.9+3ac43d95c8, reason: wrong environment (client/server only)
minecraft_1         |   at net.fabricmc.loader.impl.discovery.ModResolver.findCompatibleSet(ModResolver.java:183) ~[fabric-loader-0.12.8.jar:?]
minecraft_1         |   at net.fabricmc.loader.impl.discovery.ModResolver.resolve(ModResolver.java:48) ~[fabric-loader-0.12.8.jar:?]
minecraft_1         |   at net.fabricmc.loader.impl.FabricLoaderImpl.setup(FabricLoaderImpl.java:222) ~[fabric-loader-0.12.8.jar:?]
minecraft_1         |   at net.fabricmc.loader.impl.FabricLoaderImpl.load(FabricLoaderImpl.java:186) ~[fabric-loader-0.12.8.jar:?]
minecraft_1         |   ... 8 more
minecraft_1         | 2021-12-12T19:03:08.764Z  WARN    mc-server-runner        sub-process failed      {"exitCode": 1}
minecraft_1         | 2021-12-12T19:03:08.764Z  INFO    mc-server-runner        Done
StoneLabs commented 2 years ago

I can reproduce this issue. This is possibly related to #1191.

You can delete fabric*.jar and server.jar from your data directory as a quick fix until we've implemented a solution. This will re-download and run the correct version of 1.18.

itzg commented 2 years ago

Re-pull the latest image to get the fabric installer updated fix.

Meanwhile @Coding-Kiwi I'm confused about what your actual problem scenario was. You left out VERSION in the compose file, so latest resolves to 1.18.1. But then you talk about setting 1.18 but didn't provide any logs to show how that didn't work. And 1.18.0 doesn't exist. Mojang always leaves off the ".0".

StoneLabs commented 2 years ago

Meanwhile @Coding-Kiwi I'm confused about what your actual problem scenario was. You left out VERSION in the compose file, so latest resolves to 1.18.1. But then you talk about setting 1.18 but didn't provide any logs to show how that didn't work. And 1.18.0 doesn't exist. Mojang always leaves off the ".0".

The problem is that after installing 1.18.1, setting VERSION=1.18 does not start the server on version 1.18. Instead it continues to start on 1.18.1.

I've verified this, but did not test to see if #1193 fixed it (yet)

Coding-Kiwi commented 2 years ago

@itzg I started the server with no version specified when minecraft 1.18.1 wasn't released yet, so it resolved to 1.18. I then restarted the docker container days later, meanwhile 1.18.1 was released and no version = latest = 1.18.1 and because 1.18.1 was causing trouble, i tried to downgrade from no version = latest to 1.18 by specifying it in compose

itzg commented 2 years ago

So going from 1.18.1 down to 1.18 it still tries to run fabric 1.18.1? Please provide the full container logs.

Coding-Kiwi commented 2 years ago

@itzg

So going from 1.18.1 down to 1.18 it still tries to run fabric 1.18.1?

Yes

The logs I posted above are the full container logs, from docker-compose up to crash, with VERSION set to 1.18

Do you need something different?

StoneLabs commented 2 years ago

I've retested. #1193 did not fix the issue.

###
### Start first time
###

[0] stone@STONE instance docker run -d -it -e EULA=TRUE -e TYPE=FABRIC -e VERSION=1.18 -v /home/stone/Temporary/tmp/instance:/data itzg/minecraft-server                                                                                                                      
7a9a778b2e0a79447c6775f5ee60d41e5cdd5954057b83677e798de7aed8adab

[0] stone@STONE instance docker logs 7a9a778b2e0a                                                                                                                                                                                                                             
[init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 8 1000 1000 4096 Dec 12 21:19 /data'
[init] Resolved version given 1.18 into 1.18
[init] Resolving type given FABRIC
[init] Checking Fabric version information.
[init] Checking Fabric Loader version information.
[init] Installing Fabric 1.18 using fabric-installer-0.10.2.jar with loader version 0.12.11
Loading Fabric Installer: 0.10.2
Installing Fabric Loader 0.12.11(1.18) on the server
Downloading required files
Downloading library net.fabricmc:tiny-mappings-parser:0.3.0+build.17
Downloading library net.fabricmc:sponge-mixin:0.10.7+mixin.0.8.4
Downloading library net.fabricmc:tiny-remapper:0.6.0
Downloading library net.fabricmc:access-widener:2.0.1
Downloading library org.ow2.asm:asm:9.2
Downloading library org.ow2.asm:asm-analysis:9.2
Downloading library org.ow2.asm:asm-commons:9.2
Downloading library org.ow2.asm:asm-tree:9.2
Downloading library org.ow2.asm:asm-util:9.2
Downloading library net.fabricmc:intermediary:1.18
Downloading library net.fabricmc:fabric-loader:0.12.11
Generating server launch JAR
Downloading Minecraft server
Existing server jar valid, not downloading
Done
Done, start server by running fabric-server-launch.jar
[init] server.properties already created, skipping
[init] Checking for JSON files.
[init] Setting initial memory to 1G and max to 1G
[init] Starting the Minecraft server...
Starting net.fabricmc.loader.impl.game.minecraft.BundlerClassPathCapture
[11:11:37] [INFO] [FabricLoader/GameProvider]: Loading Minecraft 1.18 with Fabric Loader 0.12.11
[11:11:38] [main/INFO]: Loading Minecraft 1.18 with Fabric Loader 0.12.11
[...]

###
### Starting once using 1.18.1
###

[0] stone@STONE instance docker run -d -it -e EULA=TRUE -e TYPE=FABRIC -e VERSION=1.18.1 -v /home/stone/Temporary/tmp/instance:/data itzg/minecraft-server                                                                                                                    
921bbd8b855e01123237619ec9149e29f030734c000d7599b9deef099ad2c6fd

[0] stone@STONE instance docker logs 921bbd8b855e                                                                                                                                                                                                                             
[init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 8 1000 1000 4096 Dec 13 11:11 /data'
[init] Resolved version given 1.18.1 into 1.18.1
[init] Resolving type given FABRIC
[init] Checking Fabric version information.
[init] Checking Fabric Loader version information.
[init] Installing Fabric 1.18.1 using fabric-installer-0.10.2.jar with loader version 0.12.11
Loading Fabric Installer: 0.10.2
Installing Fabric Loader 0.12.11(1.18.1) on the server
Downloading required files
Downloading library net.fabricmc:tiny-mappings-parser:0.3.0+build.17
Downloading library net.fabricmc:sponge-mixin:0.10.7+mixin.0.8.4
Downloading library net.fabricmc:tiny-remapper:0.6.0
Downloading library net.fabricmc:access-widener:2.0.1
Downloading library org.ow2.asm:asm:9.2
Downloading library org.ow2.asm:asm-analysis:9.2
Downloading library org.ow2.asm:asm-commons:9.2
Downloading library org.ow2.asm:asm-tree:9.2
Downloading library org.ow2.asm:asm-util:9.2
Downloading library net.fabricmc:intermediary:1.18.1
Downloading library net.fabricmc:fabric-loader:0.12.11
Generating server launch JAR
Downloading Minecraft server
Done
Done, start server by running fabric-server-launch.jar
[init] server.properties already created, skipping
[init] Checking for JSON files.
[init] Setting initial memory to 1G and max to 1G
[init] Starting the Minecraft server...
Starting net.fabricmc.loader.impl.game.minecraft.BundlerClassPathCapture
[11:15:29] [INFO] [FabricLoader/GameProvider]: Loading Minecraft 1.18.1 with Fabric Loader 0.12.11
[11:15:30] [main/INFO]: Loading Minecraft 1.18.1 with Fabric Loader 0.12.11
[...]

###
### Go back to 1.18
###

[0] stone@STONE instance docker run -d -it -e EULA=TRUE -e TYPE=FABRIC -e VERSION=1.18 -v /home/stone/Temporary/tmp/instance:/data itzg/minecraft-server                                                                                                                      
745202e2bd30b005190f3cacf6e5c951e43ace405aae85161a195ffdf214e786

[0] stone@STONE instance docker logs 745202e2bd30                                                                                                                                                                                                                             
[init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 8 1000 1000 4096 Dec 13 11:15 /data'
[init] Resolved version given 1.18 into 1.18
[init] Resolving type given FABRIC
[init] Checking Fabric version information.
[init] server.properties already created, skipping
[init] Checking for JSON files.
[init] Setting initial memory to 1G and max to 1G
[init] Starting the Minecraft server...
Starting net.fabricmc.loader.impl.game.minecraft.BundlerClassPathCapture
[11:15:57] [INFO] [FabricLoader/GameProvider]: Loading Minecraft 1.18.1 with Fabric Loader 0.12.11
[11:15:57] [main/INFO]: Loading Minecraft 1.18.1 with Fabric Loader 0.12.11
[...]

[0] stone@STONE instance docker exec -it 745202 bash                                                                                                                                                                                                                          
root@745202e2bd30:/data# ps -aux
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
minecra+       1  0.1  0.0 705336  3368 pts/0    Ssl+ 11:15   0:00 mc-server-runner --stop-duration 60s --named-pipe /tmp/minecraft-console-in java -Xmx1G -Xms1G -Dlog4j2.formatMsgNoLookups=true -jar fabric-server-1.18-0.10.2.jar
minecra+     202  542 16.4 5815736 1335116 pts/0 Sl+  11:15   2:21 java -Xmx1G -Xms1G -Dlog4j2.formatMsgNoLookups=true -jar fabric-server-1.18-0.10.2.jar

I believe the issue might be that in

https://github.com/itzg/docker-minecraft-server/blob/79fa4b95c39897a30ad9c3d9208874d13cba9ee1/scripts/start-deployFabric#L25-L27

we check to see if the fabric jar exists. However, because 1.18 was previously installed no setup is performed. Therefore, the fabric installer is never started and thus never replaces the actual Minecraft server.jar

While the correct fabric server wrapper (1.18) is started as can be seen in the output of ps -aux, the version of the actual server jar has never been downgraded to 1.18 from 1.18.1. The sever therefore continues to run Minecraft version 1.18.1.

Coding-Kiwi commented 2 years ago

@StoneLabs thank you very much for testing!

StoneLabs commented 2 years ago

As for solutions to the problem: The first I can think of is just telling the installer to place the downloaded minecraft jar at server-{VANILLE_VERSION}.jar. Then, we can simply set fabric-server-launcher.properties to contain the correct jar on every start of the server.

Example: after installing 1.18 the server jar should be named server-1.18.jar and on each start, we should write serverJar=server-1.18.jar to fabric-server-launcher.jar. That would ensure the correct jar is used every time.

However looking at the installer source ServerHandler.jar L70-L75 it does not appear that there is an argument that allows us to specify the target of -downloadMinecraft. Which is somewhat annoying. So might want to just mv server.jar server-{VANILLA_VERSION}.jar after each launch. Idk

Would like to hear some thoughts/feedback on this.

itzg commented 2 years ago

The latest image now includes the fix from #1197 . I'll get this merged to the other image variants later today.

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.