- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
Sonarqube 10.5.1
SonarScanner CLI 6.0.0.4432
Java 17.0.1 Red Hat, Inc. (64-bit)
Linux 6.5.0-35-generic amd64
- how is SonarQube deployed: zip, Docker, Helm
Zip
- what are you trying to achieve
C++ code analysis
- what have you tried so far to achieve this
I’m trying to follow this guide: C/C++/Objective-C
When I execute:
sonar-scanner
I get this output:
08:31:41.756 INFO Scanner configuration file: /sonar-scanner/sonar-scanner-6.0.0.4432/conf/sonar-scanner.properties
08:31:41.759 INFO Project root configuration file: /program1build/sonar-project.properties
08:31:41.770 INFO SonarScanner CLI 6.0.0.4432
08:31:41.772 INFO Java 17.0.1 Red Hat, Inc. (64-bit)
08:31:41.773 INFO Linux 6.5.0-35-generic amd64
08:31:41.797 INFO User cache: /root/.sonar/cache
08:31:42.619 INFO EXECUTION FAILURE
08:31:42.623 INFO Total time: 0.866s
08:31:42.624 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.example.local/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.ConnectException: Failed to connect to sonarqube.example.local/192.168.4.87:443
at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.kt:297)
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
Caused by: java.net.ConnectException: Connection refused
at java.base/sun.nio.ch.Net.pollConnect(Native Method)
at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672)
at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:549)
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:597)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
at java.base/java.net.Socket.connect(Socket.java:633)
at okhttp3.internal.platform.Platform.connectSocket(Platform.kt:128)
at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.kt:295)
... 24 common frames omitted
08:31:42.631 ERROR
08:31:42.631 ERROR Re-run SonarScanner CLI using the -X switch to enable full debug logging.