[Mod Portal][HTTP API] /api/mods returns HTTP 500 for sort=updated_at&sort_order=desc

A place to talk about the official Factorio mod portal (https://mods.factorio.com)
mokkosu55
Manual Inserter
Manual Inserter
Posts: 2
Joined: Fri Jul 24, 2026 12:51 am
Contact:

[Mod Portal][HTTP API] /api/mods returns HTTP 500 for sort=updated_at&sort_order=desc

Post 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.
cyx2020f
Inserter
Inserter
Posts: 30
Joined: Mon Feb 03, 2020 12:12 pm
Contact:

Re: [Mod Portal][HTTP API] /api/mods returns HTTP 500 for sort=updated_at&sort_order=desc

Post 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
User avatar
QuingKhaos
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Jul 25, 2026 5:44 am
Contact:

Re: [Mod Portal][HTTP API] /api/mods returns HTTP 500 for sort=updated_at&sort_order=desc

Post 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.
User avatar
QuingKhaos
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Jul 25, 2026 5:44 am
Contact:

Re: [Mod Portal][HTTP API] /api/mods returns HTTP 500 for sort=updated_at&sort_order=desc

Post 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?
Last edited by QuingKhaos on Sat Jul 25, 2026 6:55 am, edited 1 time in total.
User avatar
QuingKhaos
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Jul 25, 2026 5:44 am
Contact:

Re: [Mod Portal][HTTP API] /api/mods returns HTTP 500 for sort=updated_at&sort_order=desc

Post 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.
cyx2020f
Inserter
Inserter
Posts: 30
Joined: Mon Feb 03, 2020 12:12 pm
Contact:

Re: [Mod Portal][HTTP API] /api/mods returns HTTP 500 for sort=updated_at&sort_order=desc

Post 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
mokkosu55
Manual Inserter
Manual Inserter
Posts: 2
Joined: Fri Jul 24, 2026 12:51 am
Contact:

Re: [Mod Portal][HTTP API] /api/mods returns HTTP 500 for sort=updated_at&sort_order=desc

Post by mokkosu55 »

Thanks for cleaning up.
I can confirm that the endpoint is now returning a successful response again.
User avatar
QuingKhaos
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Jul 25, 2026 5:44 am
Contact:

Re: [Mod Portal][HTTP API] /api/mods returns HTTP 500 for sort=updated_at&sort_order=desc

Post by QuingKhaos »

automatic publish of new extractor releases is currently paused, so this shouldn't happen in the near future again
Filcius
Inserter
Inserter
Posts: 33
Joined: Thu Mar 19, 2026 2:51 pm
Contact:

Re: [Mod Portal][HTTP API] /api/mods returns HTTP 500 for sort=updated_at&sort_order=desc

Post by Filcius »

Can you use pagination to return less results ?
User avatar
QuingKhaos
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Jul 25, 2026 5:44 am
Contact:

Re: [Mod Portal][HTTP API] /api/mods returns HTTP 500 for sort=updated_at&sort_order=desc

Post 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.
Filcius
Inserter
Inserter
Posts: 33
Joined: Thu Mar 19, 2026 2:51 pm
Contact:

Re: [Mod Portal][HTTP API] /api/mods returns HTTP 500 for sort=updated_at&sort_order=desc

Post by Filcius »

Ok, you are right.
Post Reply

Return to “Mod portal Discussion”