SonarQube "Project not found" / could not find project in CI
The scanner connected to the server but the sonar.projectKey (and on SonarCloud the sonar.organization) does not point to a project that exists, so analysis has nowhere to report results.
What this error means
The scan fails with "Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties" or "Could not find a default branch to fall back on."
ERROR: Project not found. Please check the 'sonar.projectKey' and 'sonar.organization'
properties or contact the project administrator to check the permissions of the user
the token belongs to.Common causes
projectKey or organization is wrong
A typo in sonar.projectKey, or a missing sonar.organization on SonarCloud, means the scanner targets a project that does not exist.
The project was never created on the server
Auto-provisioning is off and no project with that key exists yet, so the first analysis has no destination.
How to fix it
Match the key and organization to the server
- Open the project in SonarQube/SonarCloud and copy the exact project key.
- Set
sonar.projectKey(andsonar.organizationon SonarCloud) to those values. - Re-run the scan against the real project.
# sonar-project.properties
sonar.projectKey=my-org_my-repo
sonar.organization=my-orgCreate the project first
If the project does not exist, create it in the UI (or enable auto-provisioning) before the first CI analysis runs.
How to prevent it
- Copy the project key directly from the Sonar UI to avoid typos.
- Set
sonar.organizationfor every SonarCloud project. - Create the project before wiring up CI analysis.