Hello, we are facing 403 error associated to the Load sensor cache with SonarCloud. The analysis did not fail and even the metrics are calculated and uploaded to the SonarCloud server without issues and analysis success, the problem seems to be only with the sensor cache upload and download. This is working properly for other projects in the same organisation and with the same token, which means that the token has the proper permissions. The token is passed to the pipeline through SonarCloud context
ALM used: GitHub
CI system used: Circle CI
Languages of the repository: python
Only if the SonarCloud project is public, the URL: Project is private
Error observed:
14:10:20.078 DEBUG: GET 403 https://ea6ne4j2sb.execute-api.eu-central-1.amazonaws.com/current/v1/sensor_cache/prepare_read?organization=....
14:10:20.080 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
This issue was caused by a bug which has been resolved on February 23rd. There was no functional impacts to analyses, as they could proceed without the caching capability.
2-28T09:31:00.0477162Z [e[1;36mDEBUGe[m] 09:31:00.044 GET 403 https://ea6ne4j2sb.execute-api.eu-central-1.amazonaws.com/current/v1/sensor_cache/prepare_read?organization=xxx&project=xxx | time=546ms
2023-02-28T09:31:00.0504424Z [e[1;31mERRORe[m] 09:31:00.049 Failed to prepare download of the sensor cache
2023-02-28T09:31:00.0509722Z 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
2023-02-28T09:31:00.0513854Z
My pipeline run on Azure
- task: SonarCloudPrepare@1
inputs:
SonarCloud: 'EGS-SonarCloud'
organization: 'xxx'
scannerMode: 'Other'
extraProperties: |
# Additional properties that will be passed to the scanner,
# Put one key=value per line, example:
# sonar.exclusions=**/*.bin
sonar.verbose=true
sonar.projectKey=xxx
sonar.projectName=xxx
- task: Maven@4
inputs:
mavenPomFile: 'java-sources/pom.xml'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
options: '-debug'
javaHomeOption: 'Path'
jdkDirectory: '/usr/lib/jvm/java-11-openjdk-amd64'
mavenVersionOption: 'Default'
mavenAuthenticateFeed: false
effectivePomSkip: false
sonarQubeRunAnalysis: true
sqMavenPluginVersionChoice: 'latest'
I solved this issue. My issue happened when i was using the token which i created (I’m not admin) to connect from Azure to SonarCloud(Service connection). You should using token created by Admin