Page 1 of 1
[Mod Portal][HTTP API] /api/mods returns HTTP 500 for sort=updated_at&sort_order=desc
Posted: Fri Jul 24, 2026 1:07 am
by mokkosu55
The
Mod Portal HTTP API
/api/mods (
Mod List) appears to return an internal server error (500) when
sort=updated_at and
sort_order=desc are used together.
Reproduction
Request:
Code: Select all
https://mods.factorio.com/api/mods?sort=updated_at&sort_order=desc
Expected result:
- HTTP 200
- List of mods sorted by updated_at in descending order.
Actual result:
- HTTP 500 Internal Server Error
Comparison
The following requests work correctly (HTTP 200):
Code: Select all
https://mods.factorio.com/api/mods
https://mods.factorio.com/api/mods?sort=updated_at
https://mods.factorio.com/api/mods?sort=updated_at&sort_order=asc
https://mods.factorio.com/api/mods?sort=created_at&sort_order=desc
The issue seems to occur only when
sort=updated_at is combined with
sort_order=desc.
Additional context
I have a daily scheduled job that requests the following endpoint:
Code: Select all
https://mods.factorio.com/api/mods?sort=updated_at&sort_order=desc&version=2.0&page=1&page_size=100
This request has been working without any issues until yesterday.
The HTTP 500 error occurred for the first time during today's scheduled run at
2026-07-23T22:44:20Z.
Re: [Mod Portal][HTTP API] /api/mods returns HTTP 500 for sort=updated_at&sort_order=desc
Posted: Sat Jul 25, 2026 2:43 am
by cyx2020f
Likely caused by this
mod with 2882 dependencies:
https://mods.factorio.com/api/mods/khaosdata-extractor
The api works fine if the result doesn't contain this
mod
Re: [Mod Portal][HTTP API] /api/mods returns HTTP 500 for sort=updated_at&sort_order=desc
Posted: Sat Jul 25, 2026 5:50 am
by QuingKhaos
Sadly those are just the dependencies for the 2.1 version. The 2.0 mod list is >9000. If this dependency list is a no-go from Wube's side, I'll have to rework the usage of the extractor.
Re: [Mod Portal][HTTP API] /api/mods returns HTTP 500 for sort=updated_at&sort_order=desc
Posted: Sat Jul 25, 2026 6:52 am
by QuingKhaos
It doesn't seem to be a problem with the dependency list. If you look at
https://mods.factorio.com/api/mods/all-the-modportal that works fine and that
mod has double the dependencies than mine. I just have a lot more releases and it seems to fail on that somehow. Or a problem with the date versioning?
Re: [Mod Portal][HTTP API] /api/mods returns HTTP 500 for sort=updated_at&sort_order=desc
Posted: Sat Jul 25, 2026 7:08 am
by QuingKhaos
It definitely has to do something with the count of releases the
mod has. I just removed every release except the two latest ones and
https://mods.factorio.com/api/mods/khaosdata-extractor isn't returning a 500 anymore. Other endpoints are back too.
Re: [Mod Portal][HTTP API] /api/mods returns HTTP 500 for sort=updated_at&sort_order=desc
Posted: Sat Jul 25, 2026 7:13 am
by cyx2020f
https://mods.factorio.com/api/mods/khaosdata-extractor the
mod was cleaned and only contain 2 releases now, the problem is no longer reproducable
Re: [Mod Portal][HTTP API] /api/mods returns HTTP 500 for sort=updated_at&sort_order=desc
Posted: Sat Jul 25, 2026 12:02 pm
by mokkosu55
Thanks for cleaning up.
I can confirm that the endpoint is now returning a successful response again.
Re: [Mod Portal][HTTP API] /api/mods returns HTTP 500 for sort=updated_at&sort_order=desc
Posted: Sat Jul 25, 2026 12:05 pm
by QuingKhaos
automatic publish of new extractor releases is currently paused, so this shouldn't happen in the near future again
Re: [Mod Portal][HTTP API] /api/mods returns HTTP 500 for sort=updated_at&sort_order=desc
Posted: Sat Jul 25, 2026 1:41 pm
by Filcius
Can you use pagination to return less results ?
Re: [Mod Portal][HTTP API] /api/mods returns HTTP 500 for sort=updated_at&sort_order=desc
Posted: Sat Jul 25, 2026 2:51 pm
by QuingKhaos
Filcius wrote: Sat Jul 25, 2026 1:41 pm
Can you use pagination to return less results ?
What do you mean? OP is using pagination. But for the dependency list in the info.json of the extractor
mod there is no pagination.
Re: [Mod Portal][HTTP API] /api/mods returns HTTP 500 for sort=updated_at&sort_order=desc
Posted: Sat Jul 25, 2026 5:00 pm
by Filcius
Ok, you are right.