Skip to content
Latchkey

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.

sonar-scanner
ERROR: Project not found. Please check the 'sonar.projectKey' and 'sonar.organization'
properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator

Common 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

  1. Open the project in SonarCloud or SonarQube and read the key from its settings.
  2. Set both sonar.projectKey and sonar.organization to match exactly.
  3. Re-run the scan.
sonar-project.properties
sonar.projectKey=my-org_my-repo
sonar.organization=my-org

Create 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.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →