Unable to execute SonarScanner analysis - Java related

Sonarqube docker IMAGE ID e6c6867d5a27
SonarScanner 5.0.1.3006

  • SonarQube deployed: Docker*
    What are you trying to achieve: Scan GitHub repository
    What have you tried so far to achieve this: Create new project, token and run the code scanner in project directory

Hello I recently began running into an error when trying to utilize sonar scanner. Code scans which normally would take a couple of seconds now hang in the terminal and exit with the following error.

ERROR: Error during SonarScanner execution
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.base/java.security.AccessController.doPrivileged(AccessController.java:319)
	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:74)
	at org.sonarsource.scanner.cli.Main.main(Main.java:62)
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: Read timed out
	at java.base/sun.nio.ch.NioSocketImpl.timedRead(NioSocketImpl.java:273)
	at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:299)
	at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:340)
	at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:789)
	at java.base/java.net.Socket$SocketInputStream.read(Socket.java:1025)
	at org.sonarsource.scanner.api.internal.shaded.okio.Okio$2.read(Okio.java:140)
	at org.sonarsource.scanner.api.internal.shaded.okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
	at org.sonarsource.scanner.api.internal.shaded.okio.RealBufferedSource.read(RealBufferedSource.java:51)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http1.Http1ExchangeCodec$AbstractSource.read(Http1ExchangeCodec.java:389)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http1.Http1ExchangeCodec$UnknownLengthSource.read(Http1ExchangeCodec.java:529)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.Exchange$ResponseBodySource.read(Exchange.java:286)
	at org.sonarsource.scanner.api.internal.shaded.okio.RealBufferedSource.select(RealBufferedSource.java:100)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.Util.bomAwareCharset(Util.java:467)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.ResponseBody.string(ResponseBody.java:181)
	at org.sonarsource.scanner.api.internal.ServerConnection.downloadString(ServerConnection.java:100)
	at org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.getIndex(BootstrapIndexDownloader.java:39)
	... 10 more
ERROR: 

Any help/remediations would be greatly appreciated!

Hi,

Welcome to the community!

Typically this means a misconfiguration of the sonar.host.url value. Less commonly, there’s something “helpful” on your network interfering.

 
HTH,
Ann

Hi Ann,

Long time lurker and first time poster. Thank you very much for the insight! I will look into it see what can be done to resolve.

1 Like

@ganncamp as a follow up there was a process running on port 9000 coming from a daemon for an VPN that I had to kill and sonarscanner is now able to operate. Thanks again!

1 Like

Hi,

Thanks for following up with your details! This will probably help someone else in the future.

 
:smiley:
Ann

1 Like

it helped. Thanks :slight_smile:

1 Like