Error observed :
Yesterday (06/01/2026), everything was working fine.
Today, the analysis cannot be done any more with the following error: ERROR Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator to check the permissions of the user the token belongs to
Nothing has changed.
I’ve tried to recreate the token, verified the configuration (project name, etc…), and tried with another version of sonarsource/sonar-scanner-cli, but it just doesn’t work any more.
I could finally fix it… It was the GitLab token that expired.
I could get the right error while activating the debug output of sonar with `sonar-scaner -X`.
I just cannot understand why the analysis was still working on a branch, but not on a merge-request, this is nonsense. But replacing the gitlab token with a new one in the sonar configuration solved my issue, and my analysis is now working again.
As it as not very intuitive to find where I can replace the gitlab token in the sonar frontend, I share the info here:
Generate a new token in gitlab with the “api” scope
Got to MyProject > Administration > Organization-settings > Organization binding.
At the bottom, a message show that the token is invalid. You can update it here.