Could not find a default branch for project with key xxx Make sure the branch exists

I’m setting up sonarcloud with the circleci integration. Now, running the checks on a branch called sonarcloud. I get this error:
Error during SonarScanner execution

ERROR: Could not find a default branch for project with key 'xxx'. Make sure project exists.

I copied and pasted sonar-project.properties from the setup guide on sonarcloud.io and double checked that the key is in fact the correct project id.
The project has a default branch called main that doesn’t have a sonar-project.properties configuration file yet (because this is the change that will add that file).

I misconfigured the runner and SONAR_TOKEN was unavailable in the context.

I think a better error message would have helped me here.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.