We’re also encountering this issue all of a sudden, with no changes to our pipelines. We too are using Azure Pipelines.
The Prepare Analysis Configuration step completes without issue, and the Run Code Analysis (v1.34.0) step runs too, but it shows an error and has also caused some pipelines to hang for hours!
19:58:07.710 INFO: Load sensor cache
19:58:08.078 DEBUG: GET 403 https://ea6ne4j2sb.execute-api.eu-central-1.amazonaws.com/current/v1/sensor_cache/prepare_read?organization=MYORG&project=MYORG_MYREPONAME | time=368ms
##[error]19:58:08.083 ERROR: Failed to prepare download of the sensor cache
org.sonar.api.utils.MessageException: Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator
##[debug]Processed: ##vso[task.logissue type=error;]19:58:08.083 ERROR: Failed to prepare download of the sensor cache%0Aorg.sonar.api.utils.MessageException: Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator
19:58:08.083 ERROR: Failed to prepare download of the sensor cache
org.sonar.api.utils.MessageException: Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator
And then further on in the same pipeline execution…
19:58:44.975 DEBUG: GET 403 https://ea6ne4j2sb.execute-api.eu-central-1.amazonaws.com/current/v1/sensor_cache/prepare_write?organization=MYORG&project=MYORG_MYREPONAME | time=323ms
##[error]19:58:44.975 ERROR: Failed to prepare write of the sensor cache
org.sonar.api.utils.MessageException: Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator
##[debug]Processed: ##vso[task.logissue type=error;]19:58:44.975 ERROR: Failed to prepare write of the sensor cache%0Aorg.sonar.api.utils.MessageException: Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator
19:58:44.975 ERROR: Failed to prepare write of the sensor cache
org.sonar.api.utils.MessageException: Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator
Our pipelines are straightforward.
- task: SonarCloudPrepare@1
displayName: "Prepare analysis on SonarCloud"
inputs:
SonarCloud: $(SonarCloud_ServiceConnectionName)
organization: $(SonarCloud_OrganizationName)
scannerMode: "CLI"
configMode: "file"
configFile: "$(System.DefaultWorkingDirectory)/pipelines/sonar-project.properties"
extraProperties: |
sonar.projectVersion=$(Build.BuildNumber)
- task: SonarCloudAnalyze@1
displayName: "Run SonarCloud analysis"
- task: SonarCloudPublish@1
displayName: Publish SonarCloud Results
inputs:
pollingTimeoutSec: "300"
And the sonar-project.properties file is simple as well.
sonar.projectKey=myorg_myreponame
sonar.projectName=My-Project-Name
sonar.sources=frontend/src,backend/src
sonar.exclusions=frontend/src/testing/**,backend/src/testing/**