thunderstore-io / thunderstore-cli

Thunderstore CLI is a CLI tool for building and publishing Thunderstore packages
23 stars 11 forks source link

[Lethal Company] tcli publish category errors #99

Open KlutzyBubbles opened 6 months ago

KlutzyBubbles commented 6 months ago

Trying to publish a mod with the categories ["mods", "serverside", "clientside", "tools"] and the communities ["lethal-company"] and getting the error

ERROR: Unexpected response from the server while publishing package:
Status code: 400 BadRequest
{"categories":{"1":["Object not found"],"2":["Object not found"]}}
Exiting

This happens on 0.2.1, 0.2.2 and 0.2.3. Not sure if i am just using the incorrect categories or if there is something that is going wrong. I tried looking through the code but i am unfamiliar with where i would find anything.

Lordfirespeed commented 6 months ago

You are using the incorrect categories, yes - 'object not found' is because that list can only contain 'global' categories, not community-specific ones, and serverside and clientside (indexes 1,2) are not global categories.

You should do something like this:

[publish]
communities = ["foo", "bar"]

[publish.categories]
foo = ["mods", "foo-category-1", "foo-category-2"]
bar = ["mods", "bar-category-1", "bar-category-2"]
Lordfirespeed commented 6 months ago

It should be said, though - the error message could be seriously improved.

MythicManiac commented 6 months ago

...that list can only contain 'global' categories

They're actually not even global, but rather the categories of the domain-bound community (domains have a "main community" since previously each community had their own domain; we're still migrating away from that).

Doesn't make a significant difference in practice, just wanted to clarify

Lordfirespeed commented 6 months ago

Thankyou for clarifying! I wasn't sure where they came from / what their proper name was 😅