Sonarscanner in Mac machine failing

615 views
Skip to first unread message

vishnu...@gmail.com

unread,
Oct 3, 2017, 10:37:25 PM10/3/17
to SonarQube

I am tyring to scan swift code in Sonarqube. We have a corp proxy and I believe that is the root cause of this error.


I have set http_proxy,https_proxy and no_proxy env variables in ~/.bash_profile in mac machine.


I have setup project and sonar scanner in Mac node (via Jenkins)

iOS project build is working fine.


When sonar scan step runs, I am getting this error. Any idea why this is occuring?


In the Mac machine, I  opened sonarqube server in a browser and tested using curl like curl sonarqubeserverIP:9000 and both works fine.  I also tested curl http://SonarserverIP:9000/batch/index  and I got   " sonar-scanner-engine-shaded-6.4.jar|374981b038b5e374529204622a3992e1"


I am able to do analysis for other projects from windows and linux machines on same sonarqube server. 


Stackoverflow link : https://stackoverflow.com/questions/46538115/sonar-scanner-in-mac-failing-analysis 


09:51:24 INFO: SonarQube Scanner 3.0.3.778
09:51:24 INFO: Java 1.8.0_144 Oracle Corporation (64-bit)
09:51:24 INFO: Mac OS X 10.12.6 x86_64
09:51:24 INFO: User cache: /Users/jenkins/.sonar/cache
09:51:24 ERROR: SonarQube server [http://SonarserverIP:9000] can not be reached
09:51:24 INFO: ------------------------------------------------------------------------
09:51:24 INFO: EXECUTION FAILURE
09:51:24 INFO: ------------------------------------------------------------------------
09:51:24 INFO: Total time: 0.411s
09:51:24 INFO: Final Memory: 4M/245M
09:51:24 INFO: ------------------------------------------------------------------------
09:51:24 ERROR: Error during SonarQube Scanner execution
09:51:24 org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarQube
09:51:24    at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:84)
09:51:24    at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:71)
09:51:24    at java.security.AccessController.doPrivileged(Native Method)
09:51:24    at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:71)
09:51:24    at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:67)
09:51:24    at org.sonarsource.scanner.api.EmbeddedScanner.doStart(EmbeddedScanner.java:218)
09:51:24    at org.sonarsource.scanner.api.EmbeddedScanner.start(EmbeddedScanner.java:156)
09:51:24    at org.sonarsource.scanner.cli.Main.execute(Main.java:74)
09:51:24    at org.sonarsource.scanner.cli.Main.main(Main.java:61)
09:51:24 Caused by: java.lang.IllegalStateException: Fail to get bootstrap index from server
09:51:24    at org.sonarsource.scanner.api.internal.Jars.getBootstrapIndex(Jars.java:100)
09:51:24    at org.sonarsource.scanner.api.internal.Jars.getScannerEngineFiles(Jars.java:76)
09:51:24    at org.sonarsource.scanner.api.internal.Jars.download(Jars.java:70)
09:51:24    at org.sonarsource.scanner.api.internal.JarDownloader.download(JarDownloader.java:39)
09:51:24    at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:75)
09:51:24    ... 8 more
09:51:24 Caused by: java.lang.IllegalStateException: Status returned by url [http://SonarserverIP:9000/batch/index] is not valid: [403]
09:51:24    at org.sonarsource.scanner.api.internal.ServerConnection.callUrl(ServerConnection.java:115)
09:51:24    at org.sonarsource.scanner.api.internal.ServerConnection.downloadString(ServerConnection.java:98)
09:51:24    at org.sonarsource.scanner.api.internal.Jars.getBootstrapIndex(Jars.java:96)
09:51:24    ... 12 more
09:51:24 ERROR: 
09:51:24 ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.

G. Ann Campbell

unread,
Oct 4, 2017, 10:31:39 AM10/4/17
to SonarQube
Hi,

Please be aware that the standard courtesies (Hi, Thanks, ...) are appreciated in this group.

A 403 response means forbidden. It sounds like analysis permissions are restricted on this project and you're trying to analyze anonymously, or with the wrong account. You should identify an account that has permissions to analyze the project, generate a token for it, and pass the token to the analysis as the value of sonar.login.


Ann

Vishnu V Potti

unread,
Oct 5, 2017, 8:16:35 AM10/5/17
to G. Ann Campbell, SonarQube
HI Ann,

Thanks for pointing out the missing courtesies.  I just copied my question from stackoverflow and the courtesies are gone.

Apparently I was getting 403 because proxy not being set in sonar scanner jre. I was under the impression that sonar scanner will use system jre. 


--
You received this message because you are subscribed to a topic in the Google Groups "SonarQube" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarqube/ksBDvd3RMnU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarqube+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/068ccc11-b3cc-46db-a215-7abf2a978e42%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
REGARDS
VISHNU V POTTI

G. Ann Campbell

unread,
Oct 5, 2017, 8:27:25 AM10/5/17
to Vishnu V Potti, SonarQube
Hi,

Please don't cross-post here and on StackOverflow.


Ann



---
G. Ann Campbell | SonarSource
Product Manager
@GAnnCampbell

Vishnu V Potti

unread,
Oct 5, 2017, 8:30:59 AM10/5/17
to G. Ann Campbell, SonarQube

Hi Ann,

Since I realized sonar groups will have more expertise, I posted here.
I am not understanding how does it matter.
At the end of day it is knowledege being shared whether stackoverflow or sonar group.


To unsubscribe from this group and all its topics, send an email to sonarqube+...@googlegroups.com.

G. Ann Campbell

unread,
Oct 5, 2017, 8:32:26 AM10/5/17
to Vishnu V Potti, SonarQube
Hi,

Both venues are monitored by the community on an "at best" basis. When you cross-post, you take twice the community bandwidth.


Ann



---
G. Ann Campbell | SonarSource
Product Manager
@GAnnCampbell

To unsubscribe from this group and all its topics, send an email to sonarqube+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages