ERROR: Re-run SonarScanner using the -X switch to enable full debug logging

ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

I am using AWS Codepipleine with a stage in the pipeline for sonar cloud. It has been working for months but now failing with the error above. I am wondering what is the fix for this exactly?

This is what the Buildspec looks like for reference:

version: 0.2

env:
  variables:
    SONAR_SCANNER_VERSION: 4.4.0.2170
    SONAR_SCANNER_HOME: $HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
    SONAR_SCANNER_OPTS: -server

phases:
  install:
    commands:
       - curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
       - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
  build:
    commands:
       - $HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux/bin/sonar-scanner -Dsonar.organization=randall-reilly-eda -Dsonar.projectKey=$SONAR_SCANNER_PROJECT_KEY -Dsonar.sources=. -Dsonar.cfamily.build-wrapper-output=bw-output -Dsonar.host.url=https://sonarcloud.io -Dsonar.scm.enabled=false -Dsonar.login=$SONAR_TOKEN

Hey there.

It sounds like you should do what the error tells you to.

ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

Meaning sonar-scanner [parameters] -X

Okay, but how do I do what the error is telling me to do exactly? Add that command to the buildspec? I am not clear on what to put as parameters. When I add - sonar-scanner -X as a command in the buildspec I am receiving this error:

Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: sonar-scanner -X. Reason: exit status 127

1 Like

You’re already running sonar-scanner here. You just need to append -X.

I am getting the same here but I am running the Jenkins Pipeline and everytime I am running the pipeline its throwing me this error

ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
ERROR: SonarQube scanner exited with non-zero code: 1
Finished: FAILURE