Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow curse forge mod files to be downloaded separately #3150

Closed
TheAceMan opened this issue Nov 12, 2024 · 5 comments · Fixed by #3158
Closed

Allow curse forge mod files to be downloaded separately #3150

TheAceMan opened this issue Nov 12, 2024 · 5 comments · Fixed by #3158

Comments

@TheAceMan
Copy link

Enhancement Type

Improve an existing feature

Describe the enhancement

Modpack has logic to use the CF_DOWNLOADS_REPO and install mods that do not allow automated downloads from a downloads folder. But individual mods supplied to CURSEFORGE_FILES do not allow this. As a workaround it appears that manually downloading the file and placing it in the mods folder does work. But for re-usability it would be nice to allow it to look locally for the file and not have to worry about it when creating a new server.

@rhullah
Copy link
Contributor

rhullah commented Nov 12, 2024

There were changes done to the image (earlier this year?) to get around the blocked mods and to download them w/out issue. I honestly cannot remember the last time I've seen the table of mods that needed to be manually downloaded because it should be able to download them now.

Have you pulled the latest image recently? What mod is it not able to auto download?

@TheAceMan
Copy link
Author

@rhullah I am using the helm chart and deploying tag: itzg/minecraft-server:2024.10.2-java17

Parts of the helm chart:

minecraftServer:
  version: "1.20.1"
  type: "AUTO_CURSEFORGE"
  autoCurseForge:
    apiKey:
      existingSecret: "minecraft-secret"
      secretKey: "cf_api_key"
    slug: "create-and-farmers-delight"

extraEnv:
  CURSEFORGE_FILES: |
    https://www.curseforge.com/minecraft/mc-mods/craftable-smithing-templates-armor-trims

As you suggest there are files in the modpack that do not allow automated downloads that are downloading fine. It's when I want to add an additional mod in addition to the modpack. Maybe this is not the correct or supported way to do this?

NOTE if you do test the above, there is a broken mod (AverageAnime/create-food#1) in the modpack that I do need to also use the CF_DOWNLOADS_REPO: /data/downloads to get around. But you should be able to use any modpack to replicate.

@rhullah
Copy link
Contributor

rhullah commented Nov 16, 2024

CURSEFORGE_FILES is the way to add additional mods to a server running a modpack. Though I'm not familiar with the helm chart and if it does anything that might prevent the use of the CURSEFORGE_FILES environment variable. Are you able to verify that it sees that you set that? Are there any logs and/or errors reported in the logs? If nothing shows, you can get more log information with the DEBUG option.

@TheAceMan
Copy link
Author

I tried to look further into it but here is the end of the log that is failing. As mentioned it has the modpack and is adding 3 more mods to the server. The other 2 mods add successfully but the last does not allow automated downloads. Think the modpack and additional mods follow a different path hence not working with the auto download or the CF_DOWNLOADS_REPO option as mc-image-helper curseforge-files is a different call and does not pass in the download repo to that command.

+ mc-image-helper curseforge-files --default-category mc-mods --mod-loader FABRIC https://www.curseforge.com/minecraft/mc-mods/valkyrien-skies https://www.curseforge.com/minecraft/mc-mods/eureka-ships https://www.curseforge.com/minecraft/mc-mods/travelers-backpack-fabric craftable-smithing-templates-armor-trims
[mc-image-helper] 11:11:07.683 DEBUG : Loading cache index from ./.cache/curseforge/cache-index.json
[mc-image-helper] 11:11:08.425 DEBUG : JSON FETCH: uri=https://api.curseforge.com/v1/categories?gameId=432&classesOnly=true headers=[user-agent: itzg/mc-image-helper/1.40.2 (cmd=install-curseforge), x-fetch-session: 83163098-c693-4610-a576-5278a30b9893, x-api-key: [redacted], accept: application/json, host: api.curseforge.com]
[mc-image-helper] 11:11:08.505 DEBUG : JSON FETCH: uri=https://api.curseforge.com/v1/mods/search?gameId=432&slug=valkyrien-skies&classId=6 headers=[user-agent: itzg/mc-image-helper/1.40.2 (cmd=install-curseforge), x-fetch-session: 83163098-c693-4610-a576-5278a30b9893, x-api-key: [redacted], accept: application/json, host: api.curseforge.com]
[mc-image-helper] 11:11:08.614 DEBUG : JSON FETCH: uri=https://api.curseforge.com/v1/mods/search?gameId=432&slug=craftable-smithing-templates-armor-trims&classId=6 headers=[user-agent: itzg/mc-image-helper/1.40.2 (cmd=install-curseforge), x-fetch-session: 83163098-c693-4610-a576-5278a30b9893, x-api-key: [redacted], accept: application/json, host: api.curseforge.com]
[mc-image-helper] 11:11:08.615 DEBUG : JSON FETCH: uri=https://api.curseforge.com/v1/mods/search?gameId=432&slug=travelers-backpack-fabric&classId=6 headers=[user-agent: itzg/mc-image-helper/1.40.2 (cmd=install-curseforge), x-fetch-session: 83163098-c693-4610-a576-5278a30b9893, x-api-key: [redacted], accept: application/json, host: api.curseforge.com]
[mc-image-helper] 11:11:08.622 DEBUG : JSON FETCH: uri=https://api.curseforge.com/v1/mods/search?gameId=432&slug=eureka-ships&classId=6 headers=[user-agent: itzg/mc-image-helper/1.40.2 (cmd=install-curseforge), x-fetch-session: 83163098-c693-4610-a576-5278a30b9893, x-api-key: [redacted], accept: application/json, host: api.curseforge.com]
[mc-image-helper] 11:11:08.645 DEBUG : Getting mod file metadata for 541171:5812761
[mc-image-helper] 11:11:08.666 DEBUG : Loading cached content of getModFileInfo(541171,5812761) from ./.cache/curseforge/getModFileInfo/b08d421f-6587-4f48-94a7-c8df0633bf98.json
[mc-image-helper] 11:11:08.672 DEBUG : Getting mod metadata for 258371
[mc-image-helper] 11:11:08.677 DEBUG : Getting mod metadata for 888232
[mc-image-helper] 11:11:08.678 DEBUG : Getting mod metadata for 654384
[mc-image-helper] 11:11:08.680 DEBUG : Getting mod metadata for 541171
[mc-image-helper] 11:11:08.680 DEBUG : Loading cached content of getModInfo(258371) from ./.cache/curseforge/getModInfo/e28e26c7-dad6-4b41-898f-a742100499f6.json
[mc-image-helper] 11:11:08.680 DEBUG : JSON FETCH: uri=https://api.curseforge.com/v1/mods/654384 headers=[user-agent: itzg/mc-image-helper/1.40.2 (cmd=install-curseforge), x-fetch-session: 83163098-c693-4610-a576-5278a30b9893, x-api-key: [redacted], accept: application/json, host: api.curseforge.com]
[mc-image-helper] 11:11:08.680 DEBUG : Loading cached content of getModInfo(888232) from ./.cache/curseforge/getModInfo/b3eb1847-167c-46c1-9f8b-f2b3abf46493.json
[mc-image-helper] 11:11:08.680 DEBUG : Getting mod metadata for 310111
[mc-image-helper] 11:11:08.681 DEBUG : Getting mod metadata for 502516
[mc-image-helper] 11:11:08.682 DEBUG : JSON FETCH: uri=https://api.curseforge.com/v1/mods/310111 headers=[user-agent: itzg/mc-image-helper/1.40.2 (cmd=install-curseforge), x-fetch-session: 83163098-c693-4610-a576-5278a30b9893, x-api-key: [redacted], accept: application/json, host: api.curseforge.com]
[mc-image-helper] 11:11:08.682 DEBUG : Getting mod metadata for 238222
[mc-image-helper] 11:11:08.682 DEBUG : JSON FETCH: uri=https://api.curseforge.com/v1/mods/502516 headers=[user-agent: itzg/mc-image-helper/1.40.2 (cmd=install-curseforge), x-fetch-session: 83163098-c693-4610-a576-5278a30b9893, x-api-key: [redacted], accept: application/json, host: api.curseforge.com]
[mc-image-helper] 11:11:08.682 DEBUG : Getting mod metadata for 318449
[mc-image-helper] 11:11:08.683 DEBUG : Getting mod metadata for 544912
[mc-image-helper] 11:11:08.683 DEBUG : Getting mod metadata for 497175
[mc-image-helper] 11:11:08.684 DEBUG : JSON FETCH: uri=https://api.curseforge.com/v1/mods/318449 headers=[user-agent: itzg/mc-image-helper/1.40.2 (cmd=install-curseforge), x-fetch-session: 83163098-c693-4610-a576-5278a30b9893, x-api-key: [redacted], accept: application/json, host: api.curseforge.com]
[mc-image-helper] 11:11:08.684 DEBUG : Getting mod metadata for 341284
[mc-image-helper] 11:11:08.685 DEBUG : Getting mod metadata for 306612
[mc-image-helper] 11:11:08.685 DEBUG : Getting mod metadata for 580555
[mc-image-helper] 11:11:08.685 ERROR : The authors of the mod 'Craftable Smithing Templates (Armor Trims)' have disallowed automated downloads. Manually download the file 'craftable-smitihing-templates-1.1-Fabric.jar' from https://www.curseforge.com/minecraft/mc-mods/craftable-smithing-templates-armor-trims and supply separately.
[mc-image-helper] 11:11:08.686 DEBUG : Getting mod metadata for 348521
[mc-image-helper] 11:11:08.686 DEBUG : Loading cached content of getModInfo(238222) from ./.cache/curseforge/getModInfo/a84a15cd-6e02-4228-bd3d-b33013d15088.json
[mc-image-helper] 11:11:08.688 DEBUG : Loading cached content of getModInfo(341284) from ./.cache/curseforge/getModInfo/b48ec936-46ff-42a2-8b4d-fc2f29964aa3.json
[mc-image-helper] 11:11:08.688 DEBUG : Loading cached content of getModInfo(306612) from ./.cache/curseforge/getModInfo/c5917bb4-89b7-4638-8b26-adf380a453b5.json
[mc-image-helper] 11:11:08.688 DEBUG : Loading cached content of getModInfo(348521) from ./.cache/curseforge/getModInfo/38bcea76-b251-4aff-bd38-495ccc054bf4.json
[mc-image-helper] 11:11:08.695 DEBUG : Saving cache index to ./.cache/curseforge/cache-index.json
[mc-image-helper] 11:11:08.724 ERROR : Invalid parameter provided for 'curseforge-files' command: The authors of Craftable Smithing Templates (Armor Trims) do not allow automated downloads
[mc-image-helper] 11:11:08.724 DEBUG : Invalid parameter details
me.itzg.helpers.errors.InvalidParameterException: The authors of Craftable Smithing Templates (Armor Trims) do not allow automated downloads
        at me.itzg.helpers.curseforge.CurseForgeFilesCommand.lambda$retrieveModFile$14(CurseForgeFilesCommand.java:282)
        Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
        *__checkpoint ⇢ Retrieving 888232:4766553
Original Stack Trace:
                at me.itzg.helpers.curseforge.CurseForgeFilesCommand.lambda$retrieveModFile$14(CurseForgeFilesCommand.java:282)
                at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:132)
                at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:74)
                at reactor.core.publisher.FluxSubscribeOnCallable$CallableSubscribeOnSubscription.run(FluxSubscribeOnCallable.java:251)
                at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68)
                at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28)
                at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
                at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
                at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
                at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
                at java.base/java.lang.Thread.run(Unknown Source)
        Suppressed: java.lang.Exception: #block terminated with an error
                at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:103)
                at reactor.core.publisher.Mono.block(Mono.java:1712)
                at me.itzg.helpers.curseforge.CurseForgeFilesCommand.call(CurseForgeFilesCommand.java:144)
                at me.itzg.helpers.curseforge.CurseForgeFilesCommand.call(CurseForgeFilesCommand.java:45)
                at picocli.CommandLine.executeUserObject(CommandLine.java:2045)
                at picocli.CommandLine.access$1500(CommandLine.java:148)
                at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2465)
                at picocli.CommandLine$RunLast.handle(CommandLine.java:2457)
                at picocli.CommandLine$RunLast.handle(CommandLine.java:2419)
                at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277)
                at picocli.CommandLine$RunLast.execute(CommandLine.java:2421)
                at picocli.CommandLine.execute(CommandLine.java:2174)
                at me.itzg.helpers.McImageHelper.main(McImageHelper.java:159)

@itzg
Copy link
Owner

itzg commented Nov 22, 2024

That detail helps a bunch. I'm guessing I didn't copy over the fallback logic for individual projects vs the ones downloaded via modpack. I'll fix this at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants