SonarQube Cloud organization issues after renamed GitHub Organization

We renamed our GitHub organization, then updated the project key and repository binding for each of our projects. Afterwards, at least one of our SonarQube projects is throwing the error “Could not find a default branch for project with key ‘<organization_name>_<repository_name>’. Make sure project exists.”

I am able to view the project via GitHub and the default branch does exist. Other users seem to experience similar problems that appear to be fixed by updating the organization binding, but SonarQube users are not able to do this on their own.

  • ALM used GitHub
  • CI system used GitHub Actions
  • Languages of the repository: Java
  • Error observed Could not find a default branch for project with key '<organization_name>_<repository_name>'. Make sure project exists.
  • Steps to reproduce
    • Create a new pull request
    • quality-name runs against the branchd
    • Error visible via GitHub Actions log
  • Potential workaround: unknown

Hey @hgf-mh

Are you automatically constructing your key in your pipeline based on inputs like your org name and the repo name?

The error you’re getting would make sense if the project key being configured by the scanner no longer exists on SonarQube Cloud.

You should be able to check if the project key emitted by the scanner matches what’s on SonarQube Cloud.

Reconnecting SonarQube to our GitHub organization seems to have fixed the missing branch problem.

The Organization Binding is still linking to the old name. Plus, clicking the SonarQube logo in the upper left of the website shows me the error “The page you were looking for does not exist.” It also links to the old organization name.

Can you confirm which actions you took?

My understanding was that you should be able to fix this by uninstalling the application from your GitHub org and reinstalling the GitHub application via the org-level Administration > Organization settings > Organization binding .

I removed SonarQube from our GitHub Organization and added it back. Fixing the Organization Binding under Administration > Organization Settings.

Navigating to the homepage in any way still shows me the “The page you were looking for does not exist.” error. These links still reference the old organization name. Even though navigating through my Profile > My Organizations works as expected.

Hi @hgf-mh,

Thank you for this report. We will track this bug internally.
In the meantime, can you confirm to me that your binding is now working as expected and the only outstanding bug is that when you try to go to the GitHub organization by clicking on the organization link from SonarQube Cloud, it redirects you to the old - unexisting - one?

Thank you, and have a nice end of the week