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

Invalid game version ID: 9008 belongs to an invalid dependency. #42

Closed
Ghost-chu opened this issue Nov 23, 2022 · 13 comments
Closed

Invalid game version ID: 9008 belongs to an invalid dependency. #42

Ghost-chu opened this issue Nov 23, 2022 · 13 comments

Comments

@Ghost-chu
Copy link

https://github.com/Ghost-chu/QuickShop-Hikari/actions/runs/3531473607

When mc-publish trying release artifact to CurseForge, CF returns an 400 Bad Request response:

Error Response

Error: Failed to upload file: 400 (Bad Request, {"errorCode":1009,"errorMessage":"Invalid game version ID: 9008 belongs to an invalid dependency."})

Github Actions Logs

2022-11-23T11:07:45.3941857Z ##[group]Run Kir-Antipov/mc-publish@v3.2
2022-11-23T11:07:45.3942129Z with:
2022-11-23T11:07:45.3942344Z   modrinth-id: ijC5dDkD
2022-11-23T11:07:45.3942590Z   modrinth-featured: true
2022-11-23T11:07:45.3943113Z   modrinth-token: ***
2022-11-23T11:07:45.3943442Z   modrinth-dependencies: hXiIvTyT | recommends | *
nfGCP9fk | recommends | *

2022-11-23T11:07:45.3943786Z   github-discussion: Announcements
2022-11-23T11:07:45.3944156Z   github-token: ***
2022-11-23T11:07:45.3944386Z   github-draft: false
2022-11-23T11:07:45.3944618Z   curseforge-id: 709851
2022-11-23T11:07:45.3944916Z   curseforge-token: ***
2022-11-23T11:07:45.3945176Z   curseforge-name: QuickShop-Hikari
2022-11-23T11:07:45.3945633Z   curseforge-dependencies: vault | depends | *
protocollib | recommends | *
essentialsx | recommends | *
worldedit | recommends | *
nbt-api | recommends | *

2022-11-23T11:07:45.3946125Z   files-primary: quickshop-bukkit/target/QuickShop-Hikari-*.jar
2022-11-23T11:07:45.3946495Z   files-secondary: **/target/Compat-*.jar
2022-11-23T11:07:45.3946769Z   loaders: spigot
paper
purpur

2022-11-23T11:07:45.3947036Z   game-versions: 1.18.2
1.19
1.19.1
1.19.2

2022-11-23T11:07:45.3947271Z   java: 17

2022-11-23T11:07:45.3947517Z   modrinth-unfeature-mode: ${undefined}
2022-11-23T11:07:45.3947781Z   github-tag: ${undefined}
2022-11-23T11:07:45.3948052Z   github-generate-changelog: ${undefined}
2022-11-23T11:07:45.3948319Z   github-prerelease: ${undefined}
2022-11-23T11:07:45.3948583Z   github-commitish: ${undefined}
2022-11-23T11:07:45.3948823Z   files: ${undefined}
2022-11-23T11:07:45.3949039Z   name: ${undefined}
2022-11-23T11:07:45.3949259Z   version: ${undefined}
2022-11-23T11:07:45.3949495Z   version-type: ${undefined}
2022-11-23T11:07:45.3949738Z   changelog: ${undefined}
2022-11-23T11:07:45.3949977Z   changelog-file: ${undefined}
2022-11-23T11:07:45.3950224Z   dependencies: ${undefined}
2022-11-23T11:07:45.3950594Z   version-resolver: ${undefined}
2022-11-23T11:07:45.3950840Z   retry-attempts: 2
2022-11-23T11:07:45.3951065Z   retry-delay: 10000
2022-11-23T11:07:45.3951293Z   fail-mode: ${undefined}
2022-11-23T11:07:45.3951533Z   modrinth-files: ${undefined}
2022-11-23T11:07:45.3951793Z   modrinth-files-primary: ${undefined}
2022-11-23T11:07:45.3952091Z   modrinth-files-secondary: ${undefined}
2022-11-23T11:07:45.3952362Z   modrinth-name: ${undefined}
2022-11-23T11:07:45.3952615Z   modrinth-version: ${undefined}
2022-11-23T11:07:45.3952886Z   modrinth-version-type: ${undefined}
2022-11-23T11:07:45.3953160Z   modrinth-changelog: ${undefined}
2022-11-23T11:07:45.3953440Z   modrinth-changelog-file: ${undefined}
2022-11-23T11:07:45.3953714Z   modrinth-loaders: ${undefined}
2022-11-23T11:07:45.3953986Z   modrinth-game-versions: ${undefined}
2022-11-23T11:07:45.3954281Z   modrinth-version-resolver: ${undefined}
2022-11-23T11:07:45.3954551Z   modrinth-java: ${undefined}
2022-11-23T11:07:45.3954816Z   modrinth-retry-attempts: ${undefined}
2022-11-23T11:07:45.3955101Z   modrinth-retry-delay: ${undefined}
2022-11-23T11:07:45.3955376Z   modrinth-fail-mode: ${undefined}
2022-11-23T11:07:45.3955637Z   curseforge-files: ${undefined}
2022-11-23T11:07:45.3955918Z   curseforge-files-primary: ${undefined}
2022-11-23T11:07:45.3956228Z   curseforge-files-secondary: ${undefined}
2022-11-23T11:07:45.3956504Z   curseforge-version: ${undefined}
2022-11-23T11:07:45.3956790Z   curseforge-version-type: ${undefined}
2022-11-23T11:07:45.3957077Z   curseforge-changelog: ${undefined}
2022-11-23T11:07:45.3957373Z   curseforge-changelog-file: ${undefined}
2022-11-23T11:07:45.3957658Z   curseforge-loaders: ${undefined}
2022-11-23T11:07:45.3957942Z   curseforge-game-versions: ${undefined}
2022-11-23T11:07:45.3958252Z   curseforge-version-resolver: ${undefined}
2022-11-23T11:07:45.3958538Z   curseforge-java: ${undefined}
2022-11-23T11:07:45.3958818Z   curseforge-retry-attempts: ${undefined}
2022-11-23T11:07:45.3959115Z   curseforge-retry-delay: ${undefined}
2022-11-23T11:07:45.3959402Z   curseforge-fail-mode: ${undefined}
2022-11-23T11:07:45.3959778Z   github-files: ${undefined}
2022-11-23T11:07:45.3960048Z   github-files-primary: ${undefined}
2022-11-23T11:07:45.3960332Z   github-files-secondary: ${undefined}
2022-11-23T11:07:45.3960596Z   github-name: ${undefined}
2022-11-23T11:07:45.3960843Z   github-version: ${undefined}
2022-11-23T11:07:45.3961106Z   github-version-type: ${undefined}
2022-11-23T11:07:45.3961365Z   github-changelog: ${undefined}
2022-11-23T11:07:45.3961635Z   github-changelog-file: ${undefined}
2022-11-23T11:07:45.3961905Z   github-loaders: ${undefined}
2022-11-23T11:07:45.3962173Z   github-game-versions: ${undefined}
2022-11-23T11:07:45.3962452Z   github-dependencies: ${undefined}
2022-11-23T11:07:45.3962731Z   github-version-resolver: ${undefined}
2022-11-23T11:07:45.3962994Z   github-java: ${undefined}
2022-11-23T11:07:45.3963255Z   github-retry-attempts: ${undefined}
2022-11-23T11:07:45.3963532Z   github-retry-delay: ${undefined}
2022-11-23T11:07:45.3963796Z   github-fail-mode: ${undefined}
2022-11-23T11:07:45.3964026Z env:
2022-11-23T11:07:45.3964301Z   JAVA_HOME: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.5-8/x64
2022-11-23T11:07:45.3964687Z   JAVA_HOME_17_X64: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.5-8/x64
2022-11-23T11:07:45.3964988Z ##[endgroup]
2022-11-23T11:07:45.7063257Z 📤 Publishing assets to CurseForge...
2022-11-23T11:07:46.4936346Z ##[error]Error: Failed to upload file: 400 (Bad Request, {"errorCode":1009,"errorMessage":"Invalid game version ID: 9008 belongs to an invalid dependency."})

Actions Script

# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: mc-publish

on:
  workflow_dispatch:
  release:
     types:
       - published
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Set up JDK 17
      uses: actions/setup-java@v3
      with:
        java-version: '17'
        distribution: 'temurin'
        cache: maven
    - name: Build with Maven
      run: mvn -B package -T 16 --file pom.xml

    # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
    - name: Update dependency graph
      uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
    - uses: Kir-Antipov/mc-publish@v3.2
      with:
        modrinth-id: ijC5dDkD
        modrinth-featured: true
        modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
        modrinth-dependencies: |
          hXiIvTyT | recommends | *
          nfGCP9fk | recommends | *
  
        github-discussion: Announcements
        github-token: ${{ secrets.GITHUB_TOKEN }}
        github-draft: false
        
        curseforge-id: 709851
        curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
        curseforge-name: QuickShop-Hikari
        curseforge-dependencies: |
          vault | depends | *
          protocollib | recommends | *
          essentialsx | recommends | *
          worldedit | recommends | *
          nbt-api | recommends | *
        
        files-primary: "quickshop-bukkit/target/QuickShop-Hikari-*.jar"
        files-secondary: "**/target/Compat-*.jar"
        loaders: |
         spigot
         paper
         purpur
        game-versions: |
          1.18.2
          1.19
          1.19.1
          1.19.2
        java: |
          17

Any solution is greatly appreciated!

@Kir-Antipov
Copy link
Owner

That's the first time I've ever seen this error. 9008 is 1.18.2's id. Maybe this version is not supported on CurseForge for the type of project you are trying to publish?

@Kir-Antipov
Copy link
Owner

Kir-Antipov commented Nov 23, 2022

I think, I found the issue. CurseForge version manifest has a duplicate entry for 1.18.2:

// An original one.
// This one is used to publish mods.
{
  "id": 9008,
  "gameVersionTypeID": 73250, // Version type 73250 corresponds to Minecraft 1.18
  "name": "1.18.2",
  "slug": "1-18-2",
  "apiVersion": null
}
// And here we have this copycat.
{
  "id": 9016,
  "gameVersionTypeID": 1, // Version type 1 does not exist :)
  "name": "1.18.2",
  "slug": "1-18-2",
  "apiVersion": ""
}

"Hate" would be too nice of a word to describe my feelings towards the mess they call an API.

@Kir-Antipov
Copy link
Owner

I'll implement a workaround for such cases in the upcoming update, so thank you for the report

@Jikoo
Copy link

Jikoo commented Jan 17, 2023

It looks like you're having issues similar to what I ran into with itsmeow/curseforge-upload#16 - gameVersionTypeID 1 is Bukkit, but it's not actually declared anywhere in the API. My current action using curseforge-upload "works" only because when no valid versions are tagged CF just selects whatever the latest available Bukkit version is. This means I have to manually edit the release created to correct versions, which partially defeats the point of automating it.

I haven't poked through your source to look at your usage of the CF API, but I'm hoping it would be possible to add a CF-specific gameVersionType identifer that would support numeric values to skip the secondary lookup.

@Kir-Antipov
Copy link
Owner

it would be possible to add a CF-specific gameVersionType that would support numeric values to skip the secondary lookup

Why, though? I don't care about CF's messy "API", so why should users? Especially, when the action will be able to resolve this problem on its own

@Jikoo
Copy link

Jikoo commented Jan 24, 2023

Why, though? I don't care about CF's messy "API", so why should users? Especially, when the action will be able to resolve this problem on its own

Mostly lack of need to maintain it on your part. At the end of the day, I just want the ability to ensure that 9016 is selected for a Bukkit upload, not 9008 that a Forge/Fabric mod requires. I don't care if I have to do a little extra configuration work, I just want to avoid having to go manually edit every release's versions. If you're happy to add Bukkit, Spigot, etc. to the loader list a la #23 and make them translate to selecting only Bukkit MC versions that would also suit me just fine. It just seems more maintainable not to include magic values in your action and offload that to users.

@Kir-Antipov
Copy link
Owner

If you're happy to add Bukkit, Spigot, etc. to the loader list

Of course I am! Moving to Node16 and adding support for more project types is the key theme of the next update :)

It just seems more maintainable not to include magic values in your action and offload that to users

Don't worry, there will be no magic values that I need to constantly maintain. mc-publish will automatically detect which version it should use to publish your project (as it should, at the end of the day this project's goal is to be as zero-configy as possible)

@Zoey2936
Copy link

Error: Failed to upload file: 400 (Bad Request, {"errorCode":1009,"errorMessage":"Invalid game version ID: 6317 belongs to an invalid dependency."}) I also get a similar error, is there maybe a workaround, other then manual pushing it to curseforge?

@Kir-Antipov
Copy link
Owner

@Zoey2936, mc-publish consumes human-readable versions and converts them into CurseForge version ids internally. Therefore, sadly, if the module responsible for the conversion cannot handle CurseForge's level of weirdness, there is no getting around it.

On the bright side of things, I'm almost done with the code for the new update. However I still need to write unit tests (and a few integration ones). Also I wanted to ship a friendly documentation for the action with v4.0. So, there's still work to be done, but I'm almost there.

@Kir-Antipov
Copy link
Owner

I'm working on the issue right now, and I have a question. You were trying to publish a plugin, which supports Spigot, Paper, and Purpur, but the problem is CurseForge does not officially support anything except Bukkit. So, should mc-publish treat this as a Bukkit plugin upload? If so, can I get an exhaustive list of everything I should mask as a Bukkit plugin for CurseForge?

@Jikoo
Copy link

Jikoo commented May 1, 2023

I personally don't think you should bother with a purpur or other loader unless there's a site offering explicit support for specific forks. Purpur uses patches from Pufferfish, which in turn uses some patches from Airplane. The lines get pretty blurry, and there are an awful lot of Paper forks.

My exhaustive list for CF would be bukkit, spigot, and paper, but if you're going to add loaders for specific forks that do not differ in their plugin loading functionality, any loader that inherits the Bukkit ability to load from a plugin.yml should be fine. As dev.bukkit.org no longer has a horse in the race of Craftbukkit vs Spigot (and now vs Paper+forks), they generally don't care about which Bukkit implementation is required as long as the files uploaded are attracting site views and clicks.

The DBO side of CurseForge was intended exclusively for anything that will run on a CB server, however, DBO hasn't provided CB since the 1.7 fiasco. Spigot is now technically the lowest level Bukkit server software since Spigot declared CB unsupported software that exists only as part of the build chain a couple versions back. DBO does allow files that require Spigot's API additions and do not run on CB. I've seen plugins that target other platforms there as well, but I cannot find any explicitly stated rules. I poked around to check, and apparently you can't even make a new project right now because Overwolf is transitioning to their own system and DBO is basically an afterthought tacked on to the back side of the CF site ever since CF acquired it.

@Kir-Antipov
Copy link
Owner

Thank you for providing insight into the world of Minecraft plugins! I must admit, I'm not very familiar with this area since I haven't worked with plugins before and don't have any plans to do so.

While investigating this issue, I discovered another problem with CurseForge's versioning system. Contrary to my initial assumption that there were only two concurrent types of Minecraft versions (one for plugins and one for everything else), I found that there are actually three:

  1. One for plugins
  2. One for addons
  3. One for everything else, including mods and modpacks

What makes this situation even more baffling is that CurseForge has subcategories such as "Worlds" and "Resource Packs" within the "Addons" category, which use different Minecraft versions than their standalone counterparts. It's astonishing that a software so poorly organized, seemingly designed by individuals without any programming knowledge and a lack of basic common sense, not only continues to function but is also part of a multi-billion-dollar company. This realization just makes me appreciate Modrinth a little bit more. So, somebody, please, tell Modrinth devs that I love them and everything they stand for.

Given these circumstances, even if I were to hardcode specific project types that should use different Minecraft versions on CurseForge, I still wouldn't be able to accurately determine the correct version for resource packs and similar projects. As a result, the most viable solution appears to be trying every possible combination until one works.

For example, consider the following configuration:

loaders: |
  fabric
  forge

game-versions: |
  1.RV-Pre1
  1.12.2
  1.16.5

java: |
  Java 1.8
  Java 16

Previously, mc-publish would convert these values into CurseForge IDs like so:

[
  8203, 6756, // 1.16.5, 1.12.2
  7499, 7498, // Fabric, Forge
  4458, 8325, // Java 8, Java 16
]

Now, mc-publish generates a list of alternative IDs, such as:

[
  // Mods, modpacks, etc
  [
    8203, 6756, 5997, // 1.16.5, 1.12.2, 1.9.2
    7499, 7498, // Fabric, Forge
    4458, 8325, // Java 8, Java 16
  ],

  // Plugins
  [ 7915, 6588, 585 ], // 1.16, 1.12, 1.9

  // Addons
  [ 7997, 7434, 7431 ], // 1.16, 1.12, 1.9
]

I can then iterate through these IDs until CurseForge accepts a valid combination. I've also implemented a simple heuristic: if no IDs are found for a given list of loaders, it's more likely that the user didn't specify any mod loaders and we're dealing with a plugin. For example, with the following configuration:

loaders: |
  spigot
  paper

game-versions: |
  1.RV-Pre1
  1.12.2
  1.16.5

java: |
  Java 1.8
  Java 16

mc-publish will generate this list:

[
  // Plugins
  [ 7915, 6588, 585 ], // 1.16, 1.12, 1.9

  // Mods, modpacks, etc
  [ 8203, 6756, 5997 ], // 1.16.5, 1.12.2, 1.9.2

  // Addons
  [ 7997, 7434, 7431 ], // 1.16, 1.12, 1.9
]

So, it should take 1 try to publish a mod or a plugin and 2-3 tries (internally and without any user input, of course) to publish a resource pack or something similar to CurseForge. It's not the most elegant solution, but hey, we're dealing with the digital equivalent of a tangled ball of yarn here.

I believe this is the best way I can handle the CurseForge chaos for now.

@Kir-Antipov
Copy link
Owner

Fixed in v3.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants