- ALM used :- Bitbucket Cloud
- CI system used :- Bitbucket Cloud
- Below Scanner command used in bitbucket repository
name: Build, test and analyze on SonarCloud
image: maven:3.8.4-openjdk-17
caches:
- maven
- sonar
script:
- mvn -B verify -s settings.xml org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
-
Languages of the repository :- Java / Spring-boot
-
Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
[INFO] Communicating with SonarQube Cloud
[INFO] JRE provisioning: os[linux], arch[x86_64]
[ERROR] Failed to query JRE metadata: GET https://api.sonarcloud.io/analysis/jres?os=linux&arch=x86_64 failed with HTTP 403. Please check the property sonar.token or the environment variable SONAR_TOKEN.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
- Step to resolve :- Create new sonar token and update it in Bitbucket repository variables.
We maintain around 100+ private repositories in Bitbucket from last 4-5 years but we never faced this issue in past. But from last 1-2 weeks , We have started facing this issue in our bitbucket pipelines. After re-generating the token and updating it in Bitbucket repository variables , this issue gets resolved.
It wastes the time of developer and manual effort is required to debug the issue and create the token and update it repositories.
We would like to understand
- What is the reason of getting this error suddenly in our pipelines?
- Any solution by which these errors can be avoided.