Main component does not belong to specified organization

Hi, I’m using SonarCloud with a private Github repo and CircleCI (via the SonarCloud orb). The scan errors with “main component does not belong to specified organization”

Here is part of the logs:

INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=21ms
INFO: SCM provider for this project is: git
INFO: 3 files to be analyzed
INFO: 3/3 files analyzed
INFO: 139 files had no CPD blocks
INFO: Calculating CPD for 244 files
INFO: CPD calculation finished
INFO: SCM writing changed lines
INFO: SCM writing changed lines (done) | time=34ms
INFO: Analysis report generated in 121ms, dir size=272 KB
INFO: Analysis report compressed in 271ms, zip size=259 KB
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 37.345s
INFO: Final Memory: 54M/280M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: main component does not belong to specified organization
ERROR: 
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
Exited with code 2

Any idea what I should look for to fix this problem?

Hi, and welcome to the community!

Could you please make sure that both organization and projectKey you have set are good ones ?

Most likely this error occur when the one or another is wrong and does not belong to the organization set.

If you need more help, and your project is built with Gradle or Maven, then this other thread might also provide some hints. Otherwise let us know how you run the scanner.