Skip to content
Latchkey

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

SonarQube
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

  1. Open the project in SonarQube/SonarCloud and copy the exact project key.
  2. Set sonar.projectKey (and sonar.organization on SonarCloud) to those values.
  3. Re-run the scan against the real project.
sonar-project.properties
# sonar-project.properties
sonar.projectKey=my-org_my-repo
sonar.organization=my-org

Create 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.organization for every SonarCloud project.
  • Create the project before wiring up CI analysis.

Related guides

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