Bitbucket integration - cannot select SonarCloud project

I have a Bitbucket Cloud project which was linked to an incorrect project on SonarCloud via the official SonarCloud integration for Bitbucket.

We deleted the incorrect project from SonarCloud, but now I cannot link the Bitbucket project to the correct SonarCloud project.

I just see this screen instead, when clicking Settings under Sonarcloud in the Bitbucket repo admin:

Clicking “Log in with Bitbucket” briefly pops up an authentication window which immediately closes.
Clicking “More options” takes me to the Sonarcloud login screen.

Hi Neil,

Is the organization in which your project is bound to the correct BitBucket Team (in which the repo corresponds to your project in SonarCloud) ?


Yes, it is.

Hi Niel,

So if your organization is already bound, it means that you are in an unstable state.

If you can, you can try to uninstall the SonarCloud organization by removing the app in BitBucket Team and re-bind from SonarCloud. After that you will be able to re-import your project from SonarCloud as well.

We also will investigate on our side the redirection that seems broken after login, thanks for your feedback.

Hope it helps!

Hi Aurélie

I noticed yesterday that the settings tab was prompting me for a project, so I bound to the correct project and it seems correct now.

We have a lot of BB repos connected to SonarCloud projects in this way, so it wouldn’t have been attractive to reinstall the app.


Thank you for your feedback !

We have recently added a new project for an existing repo and can analyse it with no problem, but there’s also no way to select in BitBucket the SonarCloud project - exactly the same situation as @npadgen had.

However, we do have many other SonarCloud projects in the same organisation that are displaying the widget with no problems, even though the SonarCloud settings page in BitBucket also shows no project.

A check on the network tab in Chrome shows:

is returning at 401 with the following payload:

{"errors":[{"msg":"Authentication is required"}]}

We use Azure AD for our auth.

Should we also reinstall the app from our BitBucket team and add it back in again? and if so, will we have to relink our repos back to SonarCloud. Or, is there a better solution?