Unable to add new project to sonarcloud for analysis

When I try to add a new project into SonarCloud for analysis, it keeps getting stuck in a redirect loop and always redirects me back to the login page.

  • Versions used - SonarCloud

  • Error observed - When adding a new project ‘manually’ for analysis, I select the Organisation, enter the project key + display name, and click ‘Set Up’. And it then keeps redirecting me to the login page asking me to sign in. When I do, it trys to redirect to the new project and then ends up redirecting back to login page again.

  • Steps to reproduce -
    ** Login to Sonarcloud (using bitbucket)
    ** Go to organisation
    ** Click Analysis new project in top menu
    ** Click “create a project manually” - (i have to import them manually as I am admin of some repos in bitbucket, but not the admin of the workspace in bitbucket, so I can’t import the full workspace)
    ** Type project key + display name
    ** Click Set Up
    ** The app then redirects me to "https://sonarcloud.io/login?return_to=%2Fproject%2Foverview%3Fid%3DXXXXXXXXXXX (where xxxxxx is the project key)
    ** when I Click button “With Bitbucket” it authorises me with bitbucket then redirects me back to https://sonarcloud.io/project/overview?id=XXXXXXXXXX , and then redirects me back to https://sonarcloud.io/login?return_to=%2Fproject%2Foverview%3Fid%3DXXXXXXXXXXX again.
    ** If go to the list of projects in SonarCloud I cannot see the new XXXXXXXXXXX project, but when I try to add it again, it says the name XXXXXXXXXXX is already in use now.

  • Potential workaround - None.

  • In case of SonarCloud:

    • ALM used - Using Bitbucket Cloud
    • CI system used - Normally use Bitbucket pipelines on all our other projects, but I haven’ been able to get that far this time.

Hey there.

I’d really encourage you to work through this with your workspace admins – there are heaps of benefits to bound projects as opposed to unbound (manual) projects.

In any case, this sounds like behavior that could happen if somehow you were allowed to submit a project key that already exists (and they keep getting redirected because of a permissions issue).

Does this happen with every project key you try to use (even a long nonsense one)? Does it happen in all browsers?

Hi Colin,
Thanks for the reply.

I have just tried with a few other browsers, and that helped, as when I tried with Firefox I also got redirected back to the login page, but in Firefox it came up with an error at the top of the page saying I didn’t have access to the project.

So I started hunting around in the permissions, and it looked like someone had removed the Browse permission on the default project permissions template for the Owners group. So essentially as soon as any owner (e.g. myself) created a new project, we couldn’t browse it.

Thanks for the help, it was much appreciated.

1 Like

Thanks for diving deeper @jonohiggs. Can you share what browser (and operating system, and browser version) you were using where you didn’t get the error?

If we can reproduce, we can check if there’s anything we need to do on our side.

Hi Colin,
Was using Chrome (Version 97.0.4692.71) , on Windows 11 when I couldn’t see any error. I asked a workmate to try on his machine, and he was using MS Edge (chrome engine) on windows 10, and he had the same problem as me.

I only saw the error when I used Firefox.