Project does not exist when running SonarCloud in GitLab runner

Hello,

Since 3/4 weeks we’re current running into the problem that when the SonarCloud GitLab runner is doing the sonar scan that it reports that the project is not found and that we need to check the ‘projectkey’ and ‘organisation’ properties. This is the exact error what is reported:

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

We’ve checked our key that we have for the project and even generated new ones, but somehow it keeps displaying that the project cannot be found. I’m unable to share any links public due to our company policies. I can however share info through a private message.

ALM: GitLab Cloud
CI: GitLab Cloud
Scanner command used: dotnet-sonarscanner begin /n:$solutionName /k:“$projectKey” /v:“$version” /d:sonar.token=“$SONAR_TOKEN” /d:sonar.host.url=“https://sonarcloud.io” /d:sonar.cs.opencover.reportsPaths=“tests/**/coverage.opencover.xml” /d:sonar.coverage.exclusions=“$coverageExclusions” $sonarParams /o:“[redacted]”

We don’t have a workaround at the moment. We have currently disabled the SonarCloud step in our pipelines.

Thank you in advance.

Regards,
Michiel

Hey there.

This sounds similar to this:

Can you check your organization-level settings to see if the binding to Gitlab is still valid?

Hello Colin,

Ah, yes that was it! However we were thrown of by the fact that the Repository Binding told that the project was still bound but that the GitLab token was invalid. Maybe some banner or something like that, that tells you directly what the problem is would kind off handy :slight_smile: . However we got it resolved now thank you.

Regards,
Michiel

2 Likes

I’m a big fan of this idea, which @mpisters suggested in other thread. Crossing my fingers :crossed_fingers:

Glad this helped you out for now.