Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

HTTP response code: 429. Not doing more than 200 requests in 1 hour

mgnavarrete October 19, 2023

Hi!

Since the beginning of this week we are having a problem making requests to bitbucket Cloud. The 11th of October everything was working perfectly, we were doing about 400 requests every time we run hour script. However since Monday the execution gives as a 429 error when only around 130 requests have been done. 

 

Has something changed in the rate limit? maybe we are doing requests to fast? I don't understand why this problem is happening when rate limit is 1000. 

2 answers

0 votes
Saxea _Flowie_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 19, 2023

This ticket is also relevant BCLOUD-17723 - about rate limit increase

0 votes
mgnavarrete October 19, 2023

I am doing this request by an Oauth-token I have in workspace. But I also have more oauth for other purposes that also make requests. The requests from different oauth in same workspace count together in order to reach the rate limit?

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 19, 2023

Hello @mgnavarrete and thank you for reaching out to Community!

I've reviewed our internal logs for your workspace and it's indeed exceeding the 1000 requests per hour during some periods, which results in the 429 response code you reported.

It's important to note that rate limits are divided into a one-hour rolling window, which means that for every minute that passes, you will be provided that time to run new requests but the total you can run consecutively over an hour is 1,000. With that in mind, you can try reducing the calls per hour ratio to avoid being rate-limited.

As for your questions regarding the OAuth consumers you have in the workspace, since those credentials represent the "workspace user", and the rate-limited is applied at the user level, all the OAuth consumers' API calls sum together to calculate the rate limit. 

One alternative would be to use Workspace Access tokens instead, as each token will represent a "bot user" that will have its own rate limit. 

Hope that helps! Let me know if you have any questions :)

Thank you, @mgnavarrete !

Patrik S

mgnavarrete October 20, 2023

Thanks you for your answer, I wasn't aware of the Workspace Access tokens and they are very useful for me. However, I still have same problem due to I have more than 1000 repositories and I need to do 1 request per repository in my automation, that means I am going to encounter this very same problem every time regardless what I do. 

Is there any way to increment the rate limit for the Workspace Access tokens or for the workspace user? I understand that for normal users it is nor possible because they could collapse the server but workspace user is meant to do automation so 1000 requests is very limitating.

mgnavarrete October 20, 2023

removed

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 20, 2023

Hello @mgnavarrete ,

I'm afraid it's not currently possible to increase the rate limits are they are in place to grant the stability of the platform for all the users - we have the feature request for that BCLOUD-17723 which you can vote for.

As I mentioned above, if you decide to go with the Workspace Access token, you can create more than one token and divide the calls among them. Each access token represents a separate "bot user" in the workspace, meaning that each token will get its own 1000 requests/hour.

Another alternative, since the rate limits are calculated in a rolling hour window, is to space out the calls to the API on the script/automation you are executing.

Thank you, @mgnavarrete !
Patrik S

mgnavarrete October 23, 2023

Thanks for the info Patrik, I will vote for that feature request because sadly other solutions do not fit for us.

Like Patrik S likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events