Build fails due to Failing task since return code of [/usr/share/maven/bin/mvn --batch-mode -Djava.io.tmpdir=/tmp/GGEMOBCPO-GGEMOBLMU-JOB1 sonar:sonar -settings settings.xml -Dsonarqube.token=XXX] was 1 while expected 0


  • Versions used (SonarQube) 8.4.2
  • Error observed Build fails due to Failing task since return code of [/usr/share/maven/bin/mvn --batch-mode -Djava.io.tmpdir=/tmp/GGEMOBCPO-GGEMOBLMU-JOB1 sonar:sonar -settings settings.xml -Dsonarqube.token=XXX] was 1 while expected 0
  • Scanner command used when applicable (private details masked)
    • ALM used ( Bitbucket Data center )
    • CI system used (bamboo data center version)

Hi,

Your actual failure is higher up in your log:

[ERROR] SonarQube server [https://sonarqube.swarco.com:443] can not be reached

You need to take another look at where your SonarQube server URL is configured/passed in. At a guess, you’re not actually running it on port 443. I believe that’s usually a DB port.

 
HTH,
Ann

P.S. I was able to read this log screenshot, but it’s generally better to copy/paste the text of your logs, and code format it (``` on the line before and on the line after).

Hello Ganncamp,

We have set reverse proxy where the f5 firewall directs all the traffice through reverse proxy and connects to sonarqube.

Regards,
Charan Nagaraja

Hi,

Okay, well… You know where to look now.

 
Ann

But the reverse proxy looks good because I am able to login to the application without any issues. Could you please guide me what are the other reasosn which can cause not to reach the application.
and i am getting the plugin version issue when ever i build plan " Failing task since return code of [/usr/share/maven/bin/mvn --batch-mode -Djava.io.tmpdir=/tmp/GGEMOBCPO-GGEMOBLMU-JOB1 sonar:sonar -settings settings.xml -Dsonarqube.token=xxxxxx] was 1 while expected 0"

Hi,

Sorry, no. This is about your network.

 
Ann

Hello Ann,
So which means due to network the buildf gets this error "20-Okt-2020 16:46:31 [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project lmu-authtest: Unable to execute SonarQube: Status returned by url [https://sonarqube.swarco.com/batch/file?name=sonar-scanner-engine-shaded-8.4.2.36762-all.jar] is not valid: [403] -> [Help 1] " ?? I am trying to figure out where the authentication is blocking either from bamboo agent server or sonarqube server? any guidance or suggestions will be highly appreciable … thanks in advance.

Hi @charan.nagaraja

If you are able to login yourself but Bamboo is able to make requests to SoanrQube then there could be issue with your configuration in Bamboo, like the URL, username password or token.

Just because you can login to SonarQube using the url provided in Bamboo doesn’t mean Bamboo can. Maybe there are firewall limitations between Bamboo and SonarQube. There could also be a typo in the token, or username and password that is blocking Bamboo from accessing SonarQube.

It could also be that the reverse proxy is handling the request from Bamboo differently then those from “regular” users.

I would advice you to 1 validate the configuration in Bamboo, and 2 validate Bamboo can actually talk to SonarQube. You could use wget of curl from the terminal window on the Bamboo server/agent to validate connectivity.

Cheers,
Mark

2 Likes

@Mark_Rekveld Thanks for your inputs thats works!!