SonarQube doesn't recognize branch name in version 10.6 when using Jenkins Pipelines

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) 10.6
  • how is SonarQube deployed: zip, Docker, Helm Helm
  • what are you trying to achieve Scanning the code using the sonar scanner

Can some through some insight on this ? why i am facing the error
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Injecting SonarQube environment variables using the configuration: SonarQube
[Pipeline] {
[Pipeline] sh

  • sonar-scanner -Dsonar.pullrequest.key=1483 -Dsonar.pullrequest.branch=PRICE1-7805 -Dsonar.pullrequest.base=develop
    ERROR: Error during SonarScanner execution
    ERROR: No branch exists in Sonarqube with the name develop
    ERROR:
    ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
    [Pipeline] }
    WARN: Unable to locate ‘report-task.txt’ in the workspace. Did the SonarScanner succeed?
    [Pipeline] // withSonarQubeEnv
    [Pipeline] sh
  • tail -n 20 sonar-scanner.log
    INFO: Load/download plugins
    INFO: Load/download plugins (done) | time=636ms
    INFO: Process project properties
    INFO: Process project properties (done) | time=1307ms
    INFO: Execute project builders
    INFO: Execute project builders (done) | time=2ms
    INFO: Project key: com.tvh.microservices:ms-pricing-engine
    INFO: Base dir: /home/jenkins/agent/workspace/ricing_ms-pricing-engine_MR-1483
    INFO: Working dir: /home/jenkins/agent/workspace/ricing_ms-pricing-engine_MR-1483/.scannerwork
    INFO: Load project settings for component key: ‘com.tvh.microservices:ms-pricing-engine’
    INFO: Load project settings for component key: ‘com.tvh.microservices:ms-pricing-engine’ (done) | time=33ms
    INFO: Load project branches
    INFO: Load project branches (done) | time=1361ms
    INFO: Load branch configuration
    INFO: ------------------------------------------------------------------------
    INFO: EXECUTION FAILURE
    INFO: ------------------------------------------------------------------------
    INFO: Total time: 39.684s
    INFO: Final Memory: 13M/54M
    INFO: ------------------------------------------------------------------------
    [Pipeline] }
    [Pipeline] // stage
    [Pipeline] stage
    [Pipeline] { (Release)
    Stage “Release” skipped due to earlier failure(s)
    [Pipeline] getContext
    [Pipeline] }
    [Pipeline] // stage
    [Pipeline] stage
    [Pipeline] { (Image build and push)
    Stage “Image build and push” skipped due to earlier failure(s)
    [Pipeline] getContext
    [Pipeline] }
    [Pipeline] // stage
    [Pipeline] stage
    [Pipeline] { (Deployment trigger dev)
    Stage “Deployment trigger dev” skipped due to earlier failure(s)
    [Pipeline] getContext
    [Pipeline] }
    [Pipeline] // stage
    [Pipeline] stage
    [Pipeline] { (Generate deploy links)
    Stage “Generate deploy links” skipped due to earlier failure(s)
    [Pipeline] getContext
    [Pipeline] }
    [Pipeline] // stage
    [Pipeline] }
    [Pipeline] // timeout
    [Pipeline] }
    [Pipeline] // withEnv
    [Pipeline] }
    [Pipeline] // node
    [Pipeline] End of Pipeline
    ERROR: script returned exit code 2
    [GitLab Pipeline Status] Notifying merge request build status: FAILED CI/pricing/ms-pricing-engine/MR-1483 #20: There was a failure building this commit.
    09:44:38 [GitLab Pipeline Status] Notified
    09:44:38 Finished: FAILURE

HI @Balaganesh_Murugan,
Does youre sonarqube project contain a develop branch ? If not may scan develop branch first ?

No Sonarqube project dont have develop branch , do you want to me to scan in Jenkins ?

yes @Balaganesh_Murugan, scan develop branch first and re run the pull request.

It works thank you

It was no big deal. We’re here to help each other out.

We are facing this new issue after sonarqube upgrade to 10.6 , Any idea about the below error

13:55:10 ERROR: Error during SonarScanner execution
13:55:10 java.lang.UnsupportedClassVersionError: org/sonar/batch/bootstrapper/EnvironmentInformation has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

Hi @Balaganesh_Murugan ,

Please open a new topic to be compliante with community rules.

Yes created the new topic ==> Sonarqube upgrade to 10.6 issues of java.lang.UnsupportedClassVersionError:

Sonar scanner not working after upgrade sonarqube from 9 to 10.6 - #6 by Balaganesh_Murugan ==> This is topic i created , could you please answer there , I provided the required details over there

I have created the topic https://community.sonarsource.com/t/sonar-scanner-not-working-after-upgrade-sonarqube-from-9-to-10-6/127463/6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.