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

AUTO_CURSEFORGE - Error after backup restores

Open brimdor opened this issue 1 year ago • 6 comments

A clean setup works great. If the application is removed and added back fresh but there is a backup that can be restored, it will fail every time in the main pod/container. This creates a crashloopback and the server never starts up. My guess is the restore of the backup is lacking some data that it doesn't know what to do. I think it might be fixed if we could force a reinstall of the forge mod loader every time it boots up. Takes longer to boot but its worth it. Could also tackle the issue of the possible missing files that don't get backed up. I turned off any exclusions by the way. So it should be getting everything from /data and it looks like it does when I compare the data.

[mc-image-helper] 21:28:51.153 INFO  : Forge version 47.3.0 for minecraft version 1.20.1 is already installed
[init] Setting mode
[mc-image-helper] 21:28:52.982 INFO  : Created/updated 1 property in /data/server.properties
[init] Setting initial memory to 12G and max to 12G
[init] Using Forge supplied run.sh script...
WARNING: Unknown module: cpw.mods.securejarhandler specified to --add-exports
WARNING: Unknown module: cpw.mods.securejarhandler specified to --add-opens
WARNING: Unknown module: cpw.mods.securejarhandler specified to --add-opens
Error: Could not find or load main class cpw.mods.bootstraplauncher.BootstrapLauncher
Caused by: java.lang.ClassNotFoundException: cpw.mods.bootstraplauncher.BootstrapLauncher
2025-02-18T21:28:53.154Z	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}
2025-02-18T21:28:53.154Z	INFO	mc-server-runner	Done

brimdor avatar Feb 18 '25 21:02 brimdor

Ah that's because the .forge-manifest.json file got backed up but not the actual content of Forge. It was dry difficult to track the installed files and to do an integrity check of Forge.

Could also temporarily set CF_FORCE_REINSTALL_MODLOADER to true.

itzg avatar Feb 18 '25 22:02 itzg

oh wow! I was not expecting such a quick response. Only because I'm sure you're a busy person with all the awesome repos you keep up with.

Adding CF_FORCE_REINSTALL_MODLOADER to the values.yaml and deployment.yaml appear to have fixed the issue. This indeed reinstalls forge on every reboot of the pod which prevents any issues of missing files. I like this because it will keep the backups size smaller as it doesn't need to store all the mods and forge files as long as it has the manifest and minecraft data files, we are good to go. Thank you @itzg

What are your thoughts on adding that force reinstall env var as an option in the helm charts going forward?

brimdor avatar Feb 19 '25 15:02 brimdor

Glad to hear that helped.

As for the helm chart, there already is support for any of the env vars via extraEnv

https://github.com/itzg/minecraft-server-charts/blob/master/charts/minecraft/values.yaml#L421

The chart has become bloated with too many specialized options that hinder maintainability, so that extraEnv is the path going forward.

itzg avatar Feb 19 '25 15:02 itzg

That makes sense. I'll stick to the extraEnv Thanks again

brimdor avatar Feb 19 '25 17:02 brimdor

Well it looks like it didn't resolve as well as I thought. It seems to be holding any player data (not inventory). As my death marker is still active and my character was still in crouch position as well. I just want the game to restore from backup every time the pods get wiped out. It restores successfully but then again any changes to the world is reverted back to new.

brimdor avatar Feb 28 '25 02:02 brimdor

Sorry, that now sounds like something that is beyond my knowledge or control.

itzg avatar Feb 28 '25 12:02 itzg