I did 2 tries:
1. The first with sonar-scanner-5.0.1.3006
I launched a sonar-scanner command.
The result log:
INFO: Scanner configuration file: C:\Program Files (x86)\sonar-scanner-5.0.1.3006-windows\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: C:\Workspace\HUT-CRI-SEEDS-SCP\sonar-project.properties
08:12:23.572 INFO: SonarScanner 5.0.1.3006
08:12:23.578 INFO: Java 17.0.7 Eclipse Adoptium (64-bit)
08:12:23.579 INFO: Windows 10 10.0 amd64
08:12:23.704 DEBUG: keyStore is :
08:12:23.704 DEBUG: keyStore type is : pkcs12
08:12:23.704 DEBUG: keyStore provider is :
08:12:23.704 DEBUG: init keystore
08:12:23.705 DEBUG: init keymanager of type SunX509
08:12:23.834 DEBUG: Create: C:\Users\a0e72162\.sonar\cache
08:12:23.835 INFO: User cache: C:\Users\a0e72162\.sonar\cache
08:12:23.835 DEBUG: Create: C:\Users\a0e72162\.sonar\cache\_tmp
08:12:23.839 DEBUG: Extract sonar-scanner-api-batch in temp
08:12:23.844 DEBUG: Get bootstrap index
08:12:23.845 DEBUG: Download: **https://sonarqube_address.net/batch/index**
08:12:44.936 ERROR: SonarQube server [**https://sonarqube_address.net**] can not be reached
08:12:44.937 INFO: ------------------------------------------------------------------------
08:12:44.941 INFO: EXECUTION FAILURE
08:12:44.944 INFO: ------------------------------------------------------------------------
08:12:44.947 INFO: Total time: 21.443s
08:12:44.984 INFO: Final Memory: 3M/20M
08:12:44.985 INFO: ------------------------------------------------------------------------
08:12:44.988 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(Unknown Source)
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.ConnectException: Failed to connect to sonarqube_address.net/13.107.246.65:443
at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.RealConnection.connectSocket(RealConnection.java:265)
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:115)
at org.sonarsource.scanner.api.internal.ServerConnection.downloadString(ServerConnection.java:99)
at org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.getIndex(BootstrapIndexDownloader.java:39)
10 more
Caused by: java.net.ConnectException: Connection timed out: no further information
at java.base/sun.nio.ch.Net.pollConnect(Native Method)
at java.base/sun.nio.ch.Net.pollConnectNow(Unknown Source)
at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(Unknown Source)
at java.base/sun.nio.ch.NioSocketImpl.connect(Unknown Source)
at java.base/java.net.SocksSocketImpl.connect(Unknown Source)
at java.base/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)
31 more
08:12:45.027 ERROR:
08:12:45.027 ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
I launched an Invoke-WebRequest: Invoke-WebRequest https://sonarqube_address.net/batch/index/batch/index with a power shell
The result is ok:
StatusCode : 200
StatusDescription : OK
Content : scanner-enterprise-10.3.0.82913-all.jar|017822ac5a4cda64e2a22aeda676951f
RawContent : HTTP/1.1 200 OK
Connection: keep-alive
Strict-Transport-Security: max-age=31536000; includeSubDomains;
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff...
Forms : {}
Headers : {[Connection, keep-alive], [Strict-Transport-Security, max-age=31536000; includeSubDomains;],
[X-Frame-Options, SAMEORIGIN], [X-XSS-Protection, 1; mode=block]...}
Images : {}
InputFields : {}
Links : {}
ParsedHtml : mshtml.HTMLDocumentClass
RawContentLength : 73
2. The second with sonar-scanner-6.0.0.4432
I launched a sonar-scanner command.
The result log:
08:21:26.091 INFO Scanner configuration file: C:\Program Files (x86)\sonar-scanner-6.0.0.4432-windows\bin\..\conf\sonar-scanner.properties
08:21:26.095 INFO Project root configuration file: C:\Workspace\HUT-CRI-SEEDS-SCP\sonar-project.properties
08:21:26.107 INFO SonarScanner CLI 6.0.0.4432
08:21:26.108 INFO Java 17.0.11 Eclipse Adoptium (64-bit)
08:21:26.109 INFO Windows 10 10.0 amd64
08:21:26.117 DEBUG Scanner max available memory: 3 GB
08:21:26.129 DEBUG Create: C:\Users\a0e72162\.sonar\cache
08:21:26.130 INFO User cache: C:\Users\a0e72162\.sonar\cache
08:21:26.130 DEBUG Create: C:\Users\a0e72162\.sonar\cache\_tmp
08:21:26.273 DEBUG Successfully loaded KeyStore of the type [Windows-ROOT] having [63] entries
08:21:26.273 DEBUG Failed to load KeyStore of the type [Windows-ROOT-LOCALMACHINE]
08:21:26.299 DEBUG Successfully loaded KeyStore of the type [Windows-ROOT-CURRENTUSER] having [63] entries
08:21:26.301 DEBUG Successfully loaded KeyStore of the type [Windows-MY] having [0] entries
08:21:26.302 DEBUG Successfully loaded KeyStore of the type [Windows-MY-CURRENTUSER] having [0] entries
08:21:26.302 DEBUG Failed to load KeyStore of the type [Windows-MY-LOCALMACHINE]
08:21:26.304 DEBUG Loaded [126] system trusted certificates
08:21:26.528 DEBUG --> GET https://sonarqube_address.net/api/v2/analysis/version
08:21:31.580 DEBUG <-- HTTP FAILED: java.net.SocketTimeoutException: Connect timed out
08:21:31.581 DEBUG --> GEThttps://sonarqube_address.net/api/server/version
08:21:36.586 DEBUG <-- HTTP FAILED: java.net.SocketTimeoutException: Connect timed out
08:21:36.587 INFO EXECUTION FAILURE
08:21:36.593 INFO Total time: 10.503s
08:21:36.594 ERROR Error during SonarScanner CLI execution
java.lang.IllegalStateException: Failed to get server version
at org.sonarsource.scanner.lib.ScannerEngineBootstrapper.getServerVersion(ScannerEngineBootstrapper.java:147)
at org.sonarsource.scanner.lib.ScannerEngineBootstrapper.bootstrap(ScannerEngineBootstrapper.java:111)
at org.sonarsource.scanner.cli.Main.analyze(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:63)
Caused by: java.lang.IllegalStateException: Call to URL [https://sonarqube-p.cicd.iasp.tgscloud.net/api/v2/analysis/version] failed
at org.sonarsource.scanner.lib.internal.http.ServerConnection.callUrl(ServerConnection.java:172)
at org.sonarsource.scanner.lib.internal.http.ServerConnection.callApi(ServerConnection.java:143)
at org.sonarsource.scanner.lib.internal.http.ServerConnection.callRestApi(ServerConnection.java:121)
at org.sonarsource.scanner.lib.ScannerEngineBootstrapper.getServerVersion(ScannerEngineBootstrapper.java:142)
... 3 common frames omitted
Caused by: java.net.SocketTimeoutException: Connect timed out
at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(Unknown Source)
at java.base/sun.nio.ch.NioSocketImpl.connect(Unknown Source)
at java.base/java.net.SocksSocketImpl.connect(Unknown Source)
at java.base/java.net.Socket.connect(Unknown Source)
at okhttp3.internal.platform.Platform.connectSocket(Platform.kt:128)
at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.kt:295)
at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:207)
at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:226)
at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:106)
at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:74)
at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:255)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.kt:221)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
at org.sonarsource.scanner.lib.internal.http.ServerConnection.callUrl(ServerConnection.java:170)
... 6 common frames omitted
08:21:36.604 ERROR
08:21:36.607 ERROR Re-run SonarScanner CLI using the -X switch to enable full debug logging.
I launched an Invoke-WebRequest: Invoke-WebRequest https://sonarqube_address.net/api/v2/analysis/version with a power shell
The result is nok:
Invoke-WebRequest : Le serveur distant a retourné une erreur : (401) Non autorisé.
Au caractère Ligne:1 : 1
Invoke-WebRequest https://sonarqube_address.net/api/v2/analysis/versiont/api/v2/a ...
CategoryInfo : InvalidOperation : (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebEx
ception
FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
I launched an other Invoke-WebRequest: Invoke-WebRequest https://sonarqube_address.net/api/server/version with a power shell
The result is ok:
StatusCode : 200
StatusDescription : OK
Content : 10.3.0.82913
RawContent : HTTP/1.1 200 OK
Connection: keep-alive
Strict-Transport-Security: max-age=31536000; includeSubDomains;
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff...
Forms : {}
Headers : {[Connection, keep-alive], [Strict-Transport-Security, max-age=31536000; includeSubDomains;],
[X-Frame-Options, SAMEORIGIN], [X-XSS-Protection, 1; mode=block]...}
Images : {}
InputFields : {}
Links : {}
ParsedHtml : mshtml.HTMLDocumentClass
RawContentLength : 12
Even when the ressources exist and when it is possible to access them, it seems the the sonar-scanner can’t.
Strange ?
Is SonarQube entreprise 10.3 compatible with the sonar-scanner 6.0.0.4432 and 5.0.1.3006 ?