mc-image-helper icon indicating copy to clipboard operation
mc-image-helper copied to clipboard

Dependencies of modrinth mods aren't checked for mc version compatablilty.

Open MattiDragon opened this issue 2 years ago • 4 comments

Describe the problem

As you know, minecraft 1.19.3 released recently. I'm still running 1.19.2 while I wait for mods to catch up. When I recently restarted my server it started boot looping. Turns out it had installed 1.19.3 mods automatically. The mods in question where "YetAnotherConfigLib" and "Collective" both of which are automatically installed as my other mods depend on them. My manually specified mod are still on the correct 1.19.2 version. This is probably a bug with the image helper just downloading the latest for dependencies. As a workaround you can add the breaking dependencies at the beginning of the mod list so that they are downloaded normally and correctly.

Container definition

version: "3"

services:
  mc-main:
    image: itzg/minecraft-server
    ports:
      - 25565:25565
      - 8100:8100
      - 24454:24454/udp
    environment:
      EULA: "TRUE"
      TYPE: "FABRIC"
      VERSION: "1.19.2"

      MODRINTH_PROJECTS: "\
        server-hats,\
        bluemap,\
        banhammer,\
        luckperms,\
        minimotd,\
        chunky,\
        anti-xray,\
        styledplayerlist,\
        styled-chat,\
        ledger,\
        lithium,\
        lazydfu,\
        krypton,\
        ferrite-core,\
        c2me-fabric,\
        memoryleakfix,\
        servercore,\
        vmp-fabric,\
        debugify,\
        fabric-api,\
        universal-perms,\
        fabric-language-kotlin,\
        death-backup,\
        fastback,\
        styled-nicknames,\
        simple-voice-chat,\
        blossomtpa,\
        blossomlib,\
        spark"
      MODRINTH_ALLOWED_VERSION_TYPE: "alpha"
      MODRINTH_DOWNLOAD_OPTIONAL_DEPENDENCIES: "false"
      # Non modrinth mods
      MODS_FILE: "mods.txt"

      VANILLATWEAKS_SHARECODE: "JIx2Pm,CWpgoi"

      MAX_MEMORY: "4G"
      INIT_MEMORY: "1G"
    tty: true
    stdin_open: true
    restart: unless-stopped
    container_name: mc-main
    volumes:
      # attach a directory relative to the directory containing this compose file
      - ./main:/data
      - ./standard_configs:/config

Container logs

Paste logs here

MattiDragon avatar Dec 08 '22 16:12 MattiDragon

I will need to investigate further, but it is most likely a deficiency in the particular mod pack declarations. Image helper will traverse the dependencies by specific version unless, but does have to fallback to the latest when a project doesn't declare a specific version:

https://github.com/itzg/mc-image-helper/blob/7c945801a4e380bef129369dbb647bffae8ddec1/src/main/java/me/itzg/helpers/modrinth/ModrinthCommand.java#L123-L131

It would be extremely helpful if you could narrow down which projects are pulling in the wrong version.

FYI I'm going to move this over to mc-image-helper.

itzg avatar Dec 08 '22 22:12 itzg

mc-image-helper seems to be following the dependencies correctly as declared by the mod metadata. The first one to pull YetAnotherConfigLib is https://modrinth.com/mod/debugify/version/2.8.0 which says it requires https://modrinth.com/mod/yacl/version/2.0.0. That one says it is 1.19.3 but https://modrinth.com/mod/yacl/versions shows it should be 1.7.1.

As such, I'd say start by reporting an issue at https://github.com/isXander/Debugify/issues

itzg avatar Dec 09 '22 00:12 itzg

BTW debug output is how I initially found the bad metadata:

(Trimmed and extracted the first occurrence of YetAnotherConfigLib and dependency reference to it.)

[mc-image-helper] 18:22:21.267 DEBUG : Expanding dependencies of version=Version(id=UvBWAMZL, projectId=QwxR6Gcd, name=2.8.0 (1.19.2), datePublished=2022-10-31T17:34:15.971159Z, version=2.8.0, versionType=release, files=[VersionFile(hashes={sha512=7ad21d66192520b8bc056d33981a51901dd5150b8ea8f288418366dba73755ad352925293ea3048628e8481f0cac4d122f794a10382df52c6029e315b79587ac, sha1=34bed20ce5145eeaac14ada47aa9f269ef2cc3b5}, url=https://cdn.modrinth.com/data/QwxR6Gcd/versions/UvBWAMZL/Debugify-2.8.0.jar, filename=Debugify-2.8.0.jar, primary=true)], dependencies=[VersionDependency(versionId=null, projectId=9s6osm5g, dependencyType=optional), VersionDependency(versionId=UIAaWmvd, projectId=1eAoo2KR, dependencyType=required)], gameVersions=[1.19.2])

[mc-image-helper] 18:22:22.534 DEBUG : Resolved version=Version(id=UIAaWmvd, projectId=1eAoo2KR, name=2.0.0, datePublished=2022-12-07T16:11:25.898478Z, version=2.0.0, versionType=release, files=[VersionFile(hashes={sha512=3c644d797075acf4ccab287f4f7ac1a06714729437a073530792da4e8ba80c4a640959d9c1a4a184d12a50312a5f3762ad96dd24cb7e44f6a181a2054f25920d, sha1=93731851b542f63a29833d561dcfa198cfbc264a}, url=https://cdn.modrinth.com/data/1eAoo2KR/versions/UIAaWmvd/YetAnotherConfigLib-2.0.0.jar, filename=YetAnotherConfigLib-2.0.0.jar, primary=true)], dependencies=[VersionDependency(versionId=BXfHW8Ww, projectId=P7dR8mSH, dependencyType=required)], gameVersions=[1.19.3]) for dep=VersionDependency(versionId=UIAaWmvd, projectId=1eAoo2KR, dependencyType=required)
[mc-image-helper] 18:22:22.534 DEBUG : Expanding dependencies of version=Version(id=UIAaWmvd, projectId=1eAoo2KR, name=2.0.0, datePublished=2022-12-07T16:11:25.898478Z, version=2.0.0, versionType=release, files=[VersionFile(hashes={sha512=3c644d797075acf4ccab287f4f7ac1a06714729437a073530792da4e8ba80c4a640959d9c1a4a184d12a50312a5f3762ad96dd24cb7e44f6a181a2054f25920d, sha1=93731851b542f63a29833d561dcfa198cfbc264a}, url=https://cdn.modrinth.com/data/1eAoo2KR/versions/UIAaWmvd/YetAnotherConfigLib-2.0.0.jar, filename=YetAnotherConfigLib-2.0.0.jar, primary=true)], dependencies=[VersionDependency(versionId=BXfHW8Ww, projectId=P7dR8mSH, dependencyType=required)], gameVersions=[1.19.3])
[mc-image-helper] 18:22:22.534 DEBUG : Expanded dependency=VersionDependency(versionId=UIAaWmvd, projectId=1eAoo2KR, dependencyType=required) into version=Version(id=UIAaWmvd, projectId=1eAoo2KR, name=2.0.0, datePublished=2022-12-07T16:11:25.898478Z, version=2.0.0, versionType=release, files=[VersionFile(hashes={sha512=3c644d797075acf4ccab287f4f7ac1a06714729437a073530792da4e8ba80c4a640959d9c1a4a184d12a50312a5f3762ad96dd24cb7e44f6a181a2054f25920d, sha1=93731851b542f63a29833d561dcfa198cfbc264a}, url=https://cdn.modrinth.com/data/1eAoo2KR/versions/UIAaWmvd/YetAnotherConfigLib-2.0.0.jar, filename=YetAnotherConfigLib-2.0.0.jar, primary=true)], dependencies=[VersionDependency(versionId=BXfHW8Ww, projectId=P7dR8mSH, dependencyType=required)], gameVersions=[1.19.3])
[mc-image-helper] 18:22:22.534 DEBUG : Downloading VersionFile(hashes={sha512=3c644d797075acf4ccab287f4f7ac1a06714729437a073530792da4e8ba80c4a640959d9c1a4a184d12a50312a5f3762ad96dd24cb7e44f6a181a2054f25920d, sha1=93731851b542f63a29833d561dcfa198cfbc264a}, url=https://cdn.modrinth.com/data/1eAoo2KR/versions/UIAaWmvd/YetAnotherConfigLib-2.0.0.jar, filename=YetAnotherConfigLib-2.0.0.jar, primary=true)
[mc-image-helper] 18:22:22.536 DEBUG : Request: GET https://cdn.modrinth.com/data/1eAoo2KR/versions/UIAaWmvd/YetAnotherConfigLib-2.0.0.jar with headers [Accept-Encoding: gzip, x-gzip, deflate]
[mc-image-helper] 18:22:22.848 DEBUG : Request: GET https://cdn-raw.modrinth.com/data/1eAoo2KR/versions/UIAaWmvd/YetAnotherConfigLib-2.0.0.jar with headers [Accept-Encoding: gzip, x-gzip, deflate]

itzg avatar Dec 09 '22 00:12 itzg

I recently ran into an issue where mc-image-helper pulled an outdated dependency of an already-installed plugin due to what I assume to be a misconfigured plugin with said dependency. Perhaps a per-resource or global override to disable required dependency installation for misbehaving Modrinth resources would be beneficial here.

andriygm avatar Apr 12 '23 16:04 andriygm