Is anyone else experiencing issues with sonar cloud no longer able to find the using the project key when performing an analysis on a PR in Azure DevOps.
We have configured SonarCloud to perform a code analysis on every PR we do and we have linked the repos to 33 projects in SonarCloud. It’s been working fine for the past few months, but now it’s failing with the following errors message:
##[error]ERROR: Error during SonarScanner execution
ERROR: Project not found. Please check the ‘sonar.projectKey’ and ‘sonar.organization’ properties, the ‘SONAR_TOKEN’ environment variable, or contact the project administrator
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
ERROR: Error during SonarScanner execution
ERROR: Project not found. Please check the ‘sonar.projectKey’ and ‘sonar.organization’ properties, the ‘SONAR_TOKEN’ environment variable, or contact the project administrator
ERROR:
We have renewing the PAT just in case it was an issue with the token expiring.
It’s a bit difficult to see from the error message exactly where the issue is cropping up. Can you share a bit more of what’s happening in the logs before you receive the message?
It looks like SonarCloud faces a 401 issue getting in touch with Azure DevOps when looking up your pull request.
Can you make sure you have configured a valid token at either the project-level Administration > General Settings > Pull Requests ) or at the organiztion-level (Administration > Organization settings > Azure DevOps connectivity management )?
This is something I’ve advocated for in the past, but it has been a while. I’ll ping around on this topic (because I’m a bit tired of copy/pasting the answer!)