Get bootstrap index failed, SonarQube server cannot be reached

SonarQube 8.3.0.34182
SonarScanner for MSBuild 4.9

The last piece in us rolling out SonarQube is to get the SonarScanner working on our build machine. However, we have a problem that we don’t see on development machines. The SonarScanner is failing at the end of the build with the following:

13:39:33.564 DEBUG: Get bootstrap index...
13:39:33.564 DEBUG: Download: http://ukwok-sqube.eu.FID.priv:9000/batch/index
13:39:38.625 ERROR: SonarQube server [http://ukwok-sqube.eu.FID.priv:9000] can not be reached
13:39:38.625 INFO: ------------------------------------------------------------------------
13:39:38.626 INFO: EXECUTION FAILURE
13:39:38.626 INFO: ------------------------------------------------------------------------
13:39:38.626 INFO: Total time: 5.907s
13:39:38.647 ERROR: Error during SonarScanner execution
13:39:38.647 INFO: Final Memory: 4M/61M
13:39:38.647 INFO: ------------------------------------------------------------------------
org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarScanner analysis
	at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher$0(IsolatedLauncherFactory.java:85)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:74)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:70)
	at org.sonarsource.scanner.api.EmbeddedScanner.doStart(EmbeddedScanner.java:185)
	at org.sonarsource.scanner.api.EmbeddedScanner.start(EmbeddedScanner.java:123)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:73)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: Fail to get bootstrap index from server
	at org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.getIndex(BootstrapIndexDownloader.java:42)
	at org.sonarsource.scanner.api.internal.JarDownloader.getScannerEngineFiles(JarDownloader.java:58)
	at org.sonarsource.scanner.api.internal.JarDownloader.download(JarDownloader.java:53)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher$0(IsolatedLauncherFactory.java:76)
	... 7 more
Caused by: java.net.SocketTimeoutException: connect timed out
	at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
	at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
	at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
	at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
	at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
	at java.net.PlainSocketImpl.connect(Unknown Source)
	at java.net.SocksSocketImpl.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.platform.Platform.connectSocket(Platform.java:130)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.RealConnection.connectSocket(RealConnection.java:263)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.RealConnection.connect(RealConnection.java:183)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.java:224)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.java:108)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.ExchangeFinder.find(ExchangeFinder.java:88)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.Transmitter.newExchange(Transmitter.java:169)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:41)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.RealCall.getResponseWithInterceptorChain(RealCall.java:221)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.RealCall.execute(RealCall.java:81)
	at org.sonarsource.scanner.api.internal.ServerConnection.callUrl(ServerConnection.java:114)
	at org.sonarsource.scanner.api.internal.ServerConnection.downloadString(ServerConnection.java:99)
	at org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.getIndex(BootstrapIndexDownloader.java:39)
	... 10 more
Process returned exit code 1
The SonarQube Scanner did not complete successfully
13:39:38.718  Post-processing failed. Exit code: 1
C:\Program Files (x86)\MSBuild\FID\FID.Build.targets(772,9): error MSB3073: The command ""C:\Program Files (x86)\MSBuild\FID\SonarQube\SonarScanner.MSBuild.exe" end /d:sonar.login=3a2e09d78fac8ed1a95cb01d545a7ba2bd389da5" exited with code 1.

The difference with the build machine is that it sits in a DMZ so has restricted external access. However, at the start of the build it manages to contact the SonarQube server successfully and download the rules etc.

I’ve also checked the SonarQube server logs but there’s nothing of interest at the time of the failure.

As the exception mentions the timeout being the cause can this be adjusted or could this be a red herring? It fails at this point every time even though it contacts the server previously in the build.

I’ve attached a verbose log for the build machine and the access.log from the server, no other log files recorded anything at that time.

Many thanks.
access.log (32.2 KB) build machine not working.log (1.2 MB)

Hi,

I believe you can adjust the timeout for submitting the analysis report at the end, although to be honest it has been so very long since this came up that the details are quite fuzzy.

I think that. I think you really need to look to your network (folks) here.

That’s not clear to me from the log. TBH, I didn’t have the patience to pour jump my Find through more than 1700 lines, but what I saw before I gave up was cache hits. For the analysis part itself, getting the “bootstrap index” is the first server contact, & that’s failing.

 
:woman_shrugging:
Ann

What’s weird about this error is that the sonar-scanner fails on a URL, the one ending in /batch/index which does download with curl (proving that it is not networking or proxy security). We run https, so I can’t exclude the TLS settings from possible causes.