Skip to content

Modrinth rate limited #454

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

Closed
1 task done
foznoth opened this issue Jan 22, 2025 · 2 comments
Closed
1 task done

Modrinth rate limited #454

foznoth opened this issue Jan 22, 2025 · 2 comments

Comments

@foznoth
Copy link

foznoth commented Jan 22, 2025

Description

Currently I'm setting up my mods using ferium. I have a small script to read through a text file of all the mods and add them one by one. This works as intended.

When trying to update I get partially through the list and then get an error:
Modrinth: You have been rate limited, please wait for 0 seconds

When I run it again, I get the same, but not always at the same mod.
Reading through the issues on here, I'm suspecting this Crowdflare limiting the IP block from Virgin Media in the UK.

I have tried v4.7.1, and was getting the hanging issue discussed elsewhere.
I am currently using v4.7.0, Linux no gui.
I have tried varies thread settings, right down to 1.

I think an editable setting for time between requests may fix the issue.

Steps to reproduce

  1. Run 'ferium upgrade' with a profile of 423 mods.
  2. Partially through, but not at a repeatable mod, I get 'Modrinth: You have been rate limited, please wait for 0 seconds'
  3. Run 'ferium upgrade' again, errors at the same, or different mod.
  4. Running with various thread levels doesn't help

Operating System

Linux

Are you using the latest version of ferium?

  • I am using the latest version of ferium

Additional Information

Running v4.7.0 due to errors in v4.7.1 causing hanging at the start of the update funtion.
Other issues advised a downgrade for this.

@foznoth foznoth added the bug label Jan 22, 2025
@theRookieCoder
Copy link
Collaborator

Modrinth: You have been rate limited, please wait for 0 seconds

https://docs.modrinth.com/api#ratelimits
Modrinth has a fixed rate limit of 300 requests per minute per IP address. It's very generous, and if you exceed that, you might be doing something wrong.

In this case, you need to make use of batch requests. Ferium recently added support for adding multiple mods at once, and it will use a single batch request to obtain the metadata it needs. Make use of that feature instead of sending two requests for every mod.

Run 'ferium upgrade' with a profile of 423 mods.

Due to the way ferium resolves versions, it cannot use batch requests when upgrading. I recently implemented a feature that lets you limit the number of simultaneous network requests (#370), and you can set that to a very low number (e.g. 10) so that it spreads out over more than 1 minute and doesn't get rate limited. But I haven't released that feature yet, so you will need to compile it yourself from main or use the Actions build.

@theRookieCoder theRookieCoder closed this as not planned Won't fix, can't repro, duplicate, stale Jan 23, 2025
@foznoth
Copy link
Author

foznoth commented Jan 23, 2025

Compiling v5.0.0 did indeed fix the issue.
Thank you

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

2 participants