Hey. We have an issue in our DevOps project. We have set up SonarCloud CLI analysis, but it suddenly broke for us on 07/06/2024. We have done no code changes and this affects multiple branches in our project. Rerunning old code that succeeded now fails. The error is below. I have tried revoking the project key and added a new one, but we still encounter the same issue.
What could be the issue?
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 to check the permissions of the user the token belongs to
Is your organization still bound with a valid token? You can check the global ** Administration> Organization settings > Azure DevOps connectivity management?
If so, it would help to see a wider range of logs (specifically with verbose logging, sonar.verbose=true) to understand precisely which API call failed.
I built again with verbose enabled. The organisation contains multiple projects and the other projects seem to be working as intended. It’s just this project that has the issue. I do see that the SonarCloudAnalyze task is a deprecated version. Would it help if I upgraded it to the latest one?
09:59:10.470 INFO: EXECUTION FAILURE
09:59:10.470 INFO: ------------------------------------------------------------------------
09:59:10.470 INFO: Total time: 1:49.701s
09:59:10.750 INFO: Final Memory: 180M/607M
09:59:10.750 INFO: ------------------------------------------------------------------------
##[error]09:59:10.750 ERROR: Error during SonarScanner execution
09:59:10.750 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
09:59:10.750 ERROR:
09:59:10.750 ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
09:59:10.750 ERROR: Error during SonarScanner execution
09:59:10.750 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
09:59:10.750 ERROR:
09:59:10.750 ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
09:59:10.759 DEBUG: Cleanup org.eclipse.jgit.util.FS$FileStoreAttributes$$Lambda$282/(redacted) during JVM shutdown
##[warning]LIB_ResourceFile does not exist
##[warning]Resource file haven't been set, can't find loc string for key: LIB_ProcessExitCode
##[warning]Error while executing SonarCloud:Analyze task: LIB_ProcessExitCode /home/vsts/work/_tasks/SonarCloudAnalyze_(redacted)/1.45.1/sonar-scanner/bin/sonar-scanner 2
##[error]LIB_ProcessExitCode /home/vsts/work/_tasks/SonarCloudAnalyze_(redacted)/1.45.1/sonar-scanner/bin/sonar-scanner 2
Finishing: SonarCloudAnalyze
Are you sure you do not have an issue with your SonarCloud token or are suddenly missing permissions (such as execute analysis) for the SonarCloud user with the corresponding token?
I’ll investigate some more. I think you are correct, but I have already checked the token issues.Maybe I missed something. I’ll write here again if I find the answer