SonarCloud "Project not found. Please check the 'sonar.projectKey'" in CI
The scanner authenticated and sent a key, but the server has no project with that key under that organization. The key is present but wrong, or the project was never created.
What this error means
Analysis fails with "Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties". Common on SonarCloud where the key includes the org prefix.
ERROR: Project not found. Please check the 'sonar.projectKey' and 'sonar.organization'
properties, the 'SONAR_TOKEN' environment variable, or contact the project administratorCommon causes
The project key does not match the server project
On SonarCloud the key usually looks like org_repo. A missing organization prefix or a typo means no project matches.
The project was never created on the server
Analyzing a brand new project without first creating or auto-provisioning it means there is nothing for the key to point at.
How to fix it
Copy the exact key and organization from the project
- Open the project in SonarCloud or SonarQube and read the key from its settings.
- Set both
sonar.projectKeyandsonar.organizationto match exactly. - Re-run the scan.
sonar.projectKey=my-org_my-repo
sonar.organization=my-orgCreate or auto-provision the project first
On SonarCloud, add the repository so the project exists, or enable Automatic Analysis/auto-provisioning before the first CI scan.
How to prevent it
- Include the organization prefix in the key on SonarCloud.
- Create the project on the server before the first analysis.
- Keep the key and organization in a committed properties file.