Unable to execute code repo analysis using sonar scanner

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    I’m using latest version SonarQube server’

Sonar Scanner version - SonarQube Scanner

  • what are you trying to achieve
    I have added the sonarqube environment variable for code analysis through Jenkins pipeline.
    I have updated the below mentioned stage in Jenkins File.

    stage(‘SonarQube_Analysis’) {
    def scannerHome = tool ‘toolname’
    withSonarQubeEnv(‘sonarqube name’) {
    sh “${scannerHome}/bin/toolname”

  • what have you tried so far to achieve this

Its keep on failing on the SonarQube code analysis stage and produce this below error.

ERROR: Error during SonarScanner execution
ERROR: Validation of project reactor failed:
o “” is not a valid project or module key. It cannot be empty nor contain whitespaces.
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

I didn’t add any branches …

Please help to me fix and guide how should i add the stage in Jenkins for code repo analysis. Is the added format is correct or not…

Hi Bharath,

Can you attach the entire content of the scan log (run with -X option for debug output) along with the entire content of your Jenkins pipeline so I can take a look?