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

Too Many Requests on REST API while headers say otherwise #6241

Closed
1 task done
surli opened this issue Jun 29, 2021 · 4 comments
Closed
1 task done

Too Many Requests on REST API while headers say otherwise #6241

surli opened this issue Jun 29, 2021 · 4 comments
Assignees
Labels
bug Something is broken.
Milestone

Comments

@surli
Copy link
Contributor

surli commented Jun 29, 2021

Describe the issue

I performed a bunch of requests as an anonymous user on the REST API, it worked properly for a while until I got an HTTP 429: Too Many Requests. So I performed again a request and checked the headers to see how many time I should wait before being able again to request, but I saw that:

  X-RateLimit-Limit: 5000
  X-RateLimit-Remaining: 4865
  X-RateLimit-Reset: 2106

The doc says:

the default configuration limits it to 100 requests per day for anonymous users

but the headers are not returning the same information apparently. So not sure how I could know when I can perform my requests again.

I already tried

Describe the steps you tried to solve the problem yourself.

  • I've read and searched the docs and did not find the answer there.
    If you didn’t try already, try to search there what you wrote above.

To Reproduce the issue

Steps to reproduce the behavior:

  1. Perform 101 REST requests as anonymous user on a weblate instance

Expected behavior

The headers specify that the rate limit is 100, not 5000.

@nijel
Copy link
Member

nijel commented Jun 29, 2021

Just tested that on Hosted Weblate, and it correctly reports for unauthenticated request:

x-ratelimit-limit: 100
x-ratelimit-remaining: 99
x-ratelimit-reset: 86400

This is configured in settings, maybe you have changed that?

"DEFAULT_THROTTLE_RATES": {"anon": "100/day", "user": "5000/hour"},

@nijel nijel added the question This is more a question for the support than an issue. label Jun 29, 2021
@github-actions
Copy link

This issue looks more like a support question than an issue. We strive to answer these reasonably fast, but purchasing the support subscription is not only more responsible and faster for your business but also makes Weblate stronger.

In case your question is already answered, making a donation is the right way to say thank you!

@surli
Copy link
Contributor Author

surli commented Jun 29, 2021

This is configured in settings, maybe you have changed that?

No I just checked back and I still have the default settings for that.

I checked again on another machine, the first request I made I obtained the same than you, so I ran a script to execute 100 requests, and then I get back the headers I posted first, with the same ERROR 429: Too Many Requests.

@nijel nijel self-assigned this Jun 29, 2021
@nijel nijel added bug Something is broken. and removed question This is more a question for the support than an issue. labels Jun 29, 2021
@nijel nijel added this to the 4.7.1 milestone Jun 29, 2021
@nijel nijel closed this as completed in 3e84b63 Jun 29, 2021
@github-actions
Copy link

Thank you for your report; the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

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

No branches or pull requests

2 participants