Unable to connect Bitbucket cloud workspace


I have a problem connecting Bitbucket cloud workspace to SonarCloud.
I follow these instructions: https://sonarcloud.io/documentation/getting-started/bitbucket-cloud/
I can successfully log in using my Bitbucket credentials and can see all my workspaces in dropdown list. I select the workspace I would like to connect and click Grant access. At this point I get an error: “An unexpected error occurred. Please try again later.”

I have checked that I belong to group having Administer workspace permission enabled in Bitbucket. Weird enough is that this error happens only with one workspace. With two other workspaces I can proceed to “Import organization details” step without problems.
What might be an issue here? This is a blocker for us, because we cannot take SonarCloud into use. My Bitbucket cloud workspace is private, if that makes any difference.

Hi @simmi,

Welcome to the community!

Do you have exactly the same permissions as for the other two workspaces that works for you? In principle you should not see the organization on the dropdown if you are not administrator and cannot grant the permissions, so being able to see it, is already a proof of you having administrator permissions.

Can you take a look in the web developer logs in the browser and tell me if there is any failing request (to the sonarcloud) after you click grant access on the following screen?


Permissions are the same. After selecting Grant access I get following error in console:
request.ts:99 GET https://sonarcloud.io/api/alm_integration/show_alm_organization?installationId=ari%3Acloud%3Abitbucket%3A%3Aapp%2F{27193922-01b8-4389-8c97-e9a6af5e7cc4}%2Fsonarcloud 500
t.submit @ request.ts:99
j @ request.ts:194
C @ request.ts:202
Object.max @ alm-integration.ts:40
P @ request.ts:294
c @ alm-integration.ts:39
t.fetchAlmOrganization @ CreateOrganization.tsx:180
a.componentDidMount @ CreateOrganization.tsx:137
lo @ react-dom.production.min.js:212
pu @ react-dom.production.min.js:255
t.unstable_runWithPriority @ scheduler.production.min.js:19
Ql @ react-dom.production.min.js:122
du @ react-dom.production.min.js:248
Zo @ react-dom.production.min.js:239
(anonymous) @ react-dom.production.min.js:123
t.unstable_runWithPriority @ scheduler.production.min.js:19
Ql @ react-dom.production.min.js:122
Hl @ react-dom.production.min.js:123
U @ scheduler.production.min.js:17
T.port1.onmessage @ scheduler.production.min.js:14

Hey @simmi,

Do you do a lot of requests to your bitbucket organization? It looks like we cannot import the workspace due to exhausting the bitbucket limits connected to the resource. This although should be solved by just waiting or trying to import during the period where not a lot API calls are being made to your bitbucket org.

Could you give it another try?

I sent you also the API call being made to Bitbucket so you can execute it yourself and check if you also receive 429 (Resource exhausted).