docker-minecraft-server icon indicating copy to clipboard operation
docker-minecraft-server copied to clipboard

Provide a better way to update FTB modpacks

Open nrgbistro opened this issue 4 years ago • 23 comments

Would it be remotely possible to have a cleaner way of updating my curseforge modpacks? Maybe have an environment variable to called update-pack or something that would remove the mods and configs folder and then re-download them from the file specified by CF_SERVER_MOD? Currently, I just remove the FeedTheBeast folder which also resets all character levels, which is pretty annoying. I understand that many packs do things differently but maybe it would be possible to just download/copy over the updated mods and configs and delete everything else?

nrgbistro avatar Jul 24 '20 06:07 nrgbistro

A "hidden" feature of this new change

https://github.com/itzg/docker-minecraft-server#buggy-start-scripts

is that it will detect when the CF_SERVER_MOD has changed value (assuming a version number is part of the URL/filename), then it will prune the non-world data directories from /data/FeedTheBeast and unzip the new modpack version.

If you want to give that a try, then that will help me confirm if I should eventually set USE_MODPACK_START_SCRIPT to false by default.

itzg avatar Jul 24 '20 14:07 itzg

Just to be clear, in order to test that functionality, USE_MODPACK_START_SCRIPT should be set to false correct? I'll happily test it out when atm5 gets updated in the next week or so.

nrgbistro avatar Jul 24 '20 17:07 nrgbistro

Correct....and admittedly confusing.

itzg avatar Jul 24 '20 18:07 itzg

I agree it is slightly confusing. Maybe in the future, you could provide a bit more of an in-depth description of the difference between setting it to true or false, and also explain the basics behind the new hidden updating feature on the wiki?

I tried testing the updating feature using the previous version of atm5, and unfortunately, it did start correctly. These are the errors:

[init] ERROR Unable to find forge installer in modpack.
[init] Make sure you downloaded the server files.

ATM5 specifically uses a "simple" server startup file, which means that the zip file does not come downloaded with forge or any of the mods. The script itself takes care of that, which makes it sound like setting USE_MODPACK_START_SCRIPT=false likely will not work.

Would you be willing to look into directly accessing the curseforge API to download the server file itself from them? This functionality could be similar to GDlauncher and would make overall FTB setup way easier all around. I know GDlauncher is open-source so maybe you could take a look at how they do it? If that would be too much effort to get working effectively, would it be possible to simply run the startup script given in the server file, temporarily store its output in a folder, and then copy the mods and config folder over to the main FeedTheBeast folder?

nrgbistro avatar Jul 24 '20 19:07 nrgbistro

Ah ok, then setting that to false indeed won't work.

Can you provide any information about a curseforge API? I didn't know one existed and that would be fantastic since Curse broke things when they put the regular downloads behind an ad-delay.

itzg avatar Jul 24 '20 21:07 itzg

I was thinking it'd be cool to just paste in the modpacks link from curseforge and the container would do the rest. Here is their discord server, maybe you can ask around a bit and figure out the basics behind how they download the modpacks: https://discord.com/invite/ZxRxPqn. In the pinned messages for the developer's channel, it says this is their API, but I'm not sure if it would be of any use to you.

nrgbistro avatar Jul 24 '20 21:07 nrgbistro

Hello, is there yet a solution for updating the curseforge modpacks easier? I have been looking for a few days now, but still don't know how to do it.

eeeeb avatar Nov 22 '21 19:11 eeeeb

@eeeeb I double checked the latest code and there is built in support for upgrading the modpack when it sees the value of CF_SERVER_MOD has changed from what was previously installed.

itzg avatar Nov 23 '21 00:11 itzg

hmm I am not sure. Could be that I am doing something wrong. This is what I did with the modpack All the Magic Spellbound.

  1. On the server I removed everything from the local /data directory and ran the following docker compose file for All the Magic Spellbound Server 2.1.7 (file: /modpacks/server217.zip).
version: "3"

services:
  mc:
    image: itzg/minecraft-server:java11
    ports:
      - 25567:25565
    environment:
      EULA: "true"
      #VERSION: Latest
      #SERVER_PORT: 25566
      #QUERY_PORT: 25566
      #RCON_PORT: 25576
      TYPE: CURSEFORGE
      #FORCE_REDOWNLOAD: "true"
      #USE_MODPACK_START_SCRIPT: "false"
      CF_SERVER_MOD: /modpacks/server217.zip
      SERVER_NAME: eeeebs All the Magic Spellbound Server
      MEMORY: 16G
      OPS: eeeeb
      ENABLE_WHITELIST: "true"
      TZ: Europe/Berlin
      MOTD: "ATMS 2.1.7 - TEST"
      OVERRIDE_SERVER_PROPERTIES: "true"
      ENABLE_ROLLING_LOGS: "true"
      RCON_PASSWORD: "REDACTED"
      ICON: https://i.imgur.com/qyOkabJ.png
      STOP_SERVER_ANNOUNCE_DELAY: "60"
      #REMOVE_OLD_MODS: "true"
    volumes:
      # attach a directory relative to the directory containing this compose file
      - /home/eeeeb/portainer_container_data/minecraft/all-the-magic-spellbound-test/data:/data
      - /home/eeeeb/portainer_container_data/minecraft/all-the-magic-spellbound-test/modpacks:/modpacks
      - /home/eeeeb/backups/minecraft-all-the-magic-spellbound-test:/backup
    tty: "true"
    stdin_open: "true"
    restart: unless-stopped
  1. I connected to the server with an All the Magic Spellbound client version 2.1.7 and checked if everything looks fine, which it did.

  2. I stopped the docker container and used the following docker compose file to start the All the Magic Spellbound Server 2.1.8 (file: /modpacks/server218.zip)

version: "3"

services:
  mc:
    image: itzg/minecraft-server:java11
    ports:
      - 25567:25565
    environment:
      EULA: "true"
      #VERSION: Latest
      #SERVER_PORT: 25566
      #QUERY_PORT: 25566
      #RCON_PORT: 25576
      TYPE: CURSEFORGE
      #FORCE_REDOWNLOAD: "true"
      #USE_MODPACK_START_SCRIPT: "false"
      CF_SERVER_MOD: /modpacks/server218.zip
      SERVER_NAME: eeeebs All the Magic Spellbound Server
      MEMORY: 16G
      OPS: eeeeb
      ENABLE_WHITELIST: "true"
      TZ: Europe/Berlin
      MOTD: "ATMS 2.1.8 - TEST"
      OVERRIDE_SERVER_PROPERTIES: "true"
      ENABLE_ROLLING_LOGS: "true"
      RCON_PASSWORD: "REDACTED"
      ICON: https://i.imgur.com/qyOkabJ.png
      STOP_SERVER_ANNOUNCE_DELAY: "60"
      #REMOVE_OLD_MODS: "true"
    volumes:
      # attach a directory relative to the directory containing this compose file
      - /home/eeeeb/portainer_container_data/minecraft/all-the-magic-spellbound-test/data:/data
      - /home/eeeeb/portainer_container_data/minecraft/all-the-magic-spellbound-test/modpacks:/modpacks
      - /home/eeeeb/backups/minecraft-all-the-magic-spellbound-test:/backup
    tty: "true"
    stdin_open: "true"
    restart: unless-stopped

This is the initial part of the log from the start of the server with version 2.1.8. If you need more, then I can provide it. I did not see any mentioning of updating the server or downloading of new mods.


[init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 3 1000 1000 4096 Nov 24 15:44 /data'
[init] Resolved version given LATEST into 1.17.1
[init] Resolving type given CURSEFORGE
[init] **********************************************************************
[init] NOTE: Some mods and modpacks may require Java 8.
[init]       If so, use itzg/minecraft-server:java8
[init] **********************************************************************
[init] Looking for Feed-The-Beast / CurseForge server modpack.
[init] detected FTB, changing properties path to /data/FeedTheBeast/server.properties
[init] Creating whitelist
[init] Setting whitelist to 'true' in /data/FeedTheBeast/server.properties
[init] Setting white-list to 'true' in /data/FeedTheBeast/server.properties
[init] Setting server-name to 'eeeebs All the Magic Spellbound Server' in /data/FeedTheBeast/server.properties
[init] Setting enable-rcon to 'true' in /data/FeedTheBeast/server.properties
[init] Setting rcon.password to 'REDACTED' in /data/FeedTheBeast/server.properties
[init] Setting rcon.port to '25575' in /data/FeedTheBeast/server.properties
[init] Setting motd to 'ATMS 2.1.8 - TEST' in /data/FeedTheBeast/server.properties
[init] Updating ops
[init] log4j2.xml already created, skipping
[init] Checking for JSON files.
[init] Setting initial memory to 16G and max to 16G
[init] Running FTB /data/FeedTheBeast/startserver.sh in /data/FeedTheBeast ...
Skipping download. Using existing serverstarter-2.0.1.jar
[15:55:24] [INFO] :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
[15:55:24] [INFO]    Minecraft ServerStarter install/launcher jar
[15:55:24] [INFO]    (Created by BloodWorkXGaming & Yoosk with the help of "Team ATM")
[15:55:24] [INFO] :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
[15:55:24] [INFO] 
[15:55:24] [INFO]    This jar will launch a Minecraft Forge/Fabric Modded server
[15:55:24] [INFO] 
[15:55:24] [INFO]    Github:    https://github.com/BloodyMods/ServerStarter
[15:55:24] [INFO]    Github:    https://github.com/Yoosk/ServerStarter
[15:55:24] [INFO]    Discord:   https://discord.gg/K5FBPYa
[15:55:24] [INFO] 
[15:55:24] [INFO] You are playing All The Magic Soulbound
[15:55:24] [INFO] Starting to install/launch the server, lean back!
[15:55:24] [INFO] :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
[15:55:24] [INFO] 
[15:55:24] [INFO] Pinging 8.8.8.8.
[15:55:25] [INFO] Reached 8.8.8.8: false
[15:55:25] [INFO] Pinging 1.0.0.1.
[15:55:26] [INFO] Reached 1.0.0.1: false
[15:55:26] [INFO] Reached 0 out of 2 IPs.
[15:55:26] [ERROR] Not every host could be reached. There could be a problem with your internet connection!!!!
[15:55:26] [INFO] Server is already installed to correct version, to force install delete the serverstarter.lock File.
[15:55:26] [INFO] Starting Loader, output incoming
2021-11-24 15:55:28,747 main WARN Advanced terminal features are not available in this environment
[15:55:28] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher running: args [--gameDir, ., --launchTarget, fmlserver, --fml.forgeVersion, 36.2.9, --fml.mcpVersion, 20210115.111550, --fml.mcVersion, 1.16.5, --fml.forgeGroup, net.minecraftforge, nogui]
[15:55:28] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher 8.0.9+86+master.3cf110c starting: java version 11.0.11 by AdoptOpenJDK
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by cpw.mods.modlauncher.SecureJarHandler (file:/data/FeedTheBeast/libraries/cpw/mods/modlauncher/8.0.9/modlauncher-8.0.9.jar) to field java.util.jar.Manifest.jv
WARNING: Please consider reporting this to the maintainers of cpw.mods.modlauncher.SecureJarHandler
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[15:55:29] [main/INFO] [ne.mi.fm.lo.FixSSL/CORE]: Added Lets Encrypt root certificates as additional trust
[15:55:29] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.4 Source=file:/data/FeedTheBeast/libraries/org/spongepowered/mixin/0.8.4/mixin-0.8.4.jar Service=ModLauncher Env=SERVER
[15:55:30] [main/INFO] [STDERR/]: [jdk.nashorn.api.scripting.NashornScriptEngine:<init>:143]: Warning: Nashorn engine is planned to be removed from a future JDK release
  1. I connected to the server with an All the Magic Spellbound client version 2.1.8, which resulted in the message:

Closed connection - mismatched mod channel list.

  1. I connected to the server with an All the Magic Spellbound client version 2.1.7 and checked if everything looks fine, which it did.

It seems to not update the server when I change CF_SERVER_MOD: from /modpacks/server217.zip to CF_SERVER_MOD: /modpacks/server218.zip.

Do I need to do something else or is this perhaps not working with this specific mod pack?

eeeeb avatar Nov 24 '21 15:11 eeeeb

Anyone else having the same issues?

eeeeb avatar Dec 06 '21 07:12 eeeeb

@eeeeb I double checked the latest code and there is built in support for upgrading the modpack when it sees the value of CF_SERVER_MOD has changed from what was previously installed.

@itzg I assume at the start of the container it compares the current filename to the previous one. And to do that, I assume the previous filename is stored somewhere? Or how does it work?

eeeeb avatar Dec 12 '21 12:12 eeeeb

Yes it stores and compares it from a "hidden" file here

https://github.com/itzg/docker-minecraft-server/blob/c4aa10504219f7bfcb019cfc136643ecfa5da5f6/scripts/start-deployCF#L45

itzg avatar Dec 12 '21 14:12 itzg

Yes it stores and compares it from a "hidden" file here

https://github.com/itzg/docker-minecraft-server/blob/c4aa10504219f7bfcb019cfc136643ecfa5da5f6/scripts/start-deployCF#L45

Thank you @itzg, I cannot see this file in my data folder MobaXterm_Personal_rloY8mVlNY

eeeeb avatar Dec 12 '21 14:12 eeeeb

(Sorry for previous comment. Screenshots of consoles are hard to see.)

Is USE_MODPACK_START_SCRIPT set to false?

itzg avatar Dec 12 '21 17:12 itzg

(Sorry for previous comment. Screenshots of consoles are hard to see.)

Is USE_MODPACK_START_SCRIPT set to false?

No #USE_MODPACK_START_SCRIPT: "false" is currently commented out. I am currently not using/setting this environment variable. Should I set it to false?

eeeeb avatar Dec 12 '21 17:12 eeeeb

(Sorry for previous comment. Screenshots of consoles are hard to see.)

Is USE_MODPACK_START_SCRIPT set to false?

@itzg I tested it out by setting USE_MODPACK_START_SCRIPT: "false" but now I get the following error:

[init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 3 1000 1000 4096 Dec 12 21:35 /data' [init] Resolved version given LATEST into 1.18.1 [init] Resolving type given CURSEFORGE [init] ********************************************************************** [init] NOTE: Some mods and modpacks may require Java 8. [init] If so, use itzg/minecraft-server:java8 [init] ********************************************************************** [init] Looking for Feed-The-Beast / CurseForge server modpack. [init] Unpacking FTB server modpack /modpacks/SIMPLE-SERVER-FILES-1.1.9.zip ... .... [init] ERROR Unable to find forge installer in modpack [init] or download using modpack config. [init] Make sure you downloaded the server files.

The zip file SIMPLE-SERVER-FILES-1.1.9.zip contains 3 files

  • startserver.sh
  • startserver.bat
  • server-setup-config.yaml

eeeeb avatar Dec 12 '21 20:12 eeeeb

I can't find a modpack for SIMPLE-SERVER-FILES-1.1.9.zip, so I am unable to help recreate the issue or explore what those three files contain.

itzg avatar Dec 13 '21 02:12 itzg

I can't find a modpack for SIMPLE-SERVER-FILES-1.1.9.zip, so I am unable to help recreate the issue or explore what those three files contain.

@itzg It is the All the Mods 6 - To the Sky - ATM6sky - Skyblock modpack, but the ATM7 has the same file structure.

eeeeb avatar Dec 13 '21 07:12 eeeeb

It seems like new modpacks from CurseForge added a different method of deploying modded forge servers with the SIMPLE-SERVER-FILES. These files contain a Modpack descriptor and a "startserver" script which downloads all necessary files and starts the forge server. I would guess this would mean another layer of complexity would have to be implemented to also support SIMPLE-SERVER-FILES method. Another way would be to manually execute the script and somehow transfer the resulting folder to the docker mounted volume.

ckocyigit avatar Jan 11 '22 12:01 ckocyigit

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.

github-actions[bot] avatar Feb 11 '22 02:02 github-actions[bot]

Any updates on this? Im trying to update my ATM7 - To the sky pack but having difficulities. Iv already borked one world.

hobbit44 avatar Oct 31 '22 11:10 hobbit44

Unfortunately, not that I know of @Hobbit44 . I am slowly working towards moving the modpack processing over to https://github.com/itzg/mc-image-helper and with that can manage upgrade scenarios better.

itzg avatar Nov 06 '22 14:11 itzg

I came across the same issue as @Hobbit44 when updating ATM7 to the sky, and I'm kinda confused now. Can I use the “auto update” (where it compares with the hidden file) only when also disabling the buggy startup scripts? Also, how should I manually update the server, which files do I copy and which do I leave alone?

ThomasW2005 avatar Nov 18 '22 19:11 ThomasW2005