08:10:52.927 INFO: Scanner configuration file: /home/anguyen/sonarqube/sonar-scanner/conf/sonar-scanner.properties
08:10:52.932 INFO: Project root configuration file: /home/anguyen/swat-dev/SWAT/AFCAP/Common/sonar-project.properties
08:10:52.958 INFO: SonarQube Scanner 4.2.0.1873
08:10:52.958 INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
08:10:52.958 INFO: Linux 3.10.0-1127.el7.x86_64 amd64
08:10:53.109 DEBUG: keyStore is :
08:10:53.109 DEBUG: keyStore type is : pkcs12
08:10:53.109 DEBUG: keyStore provider is :
08:10:53.109 DEBUG: init keystore
08:10:53.109 DEBUG: init keymanager of type SunX509
08:10:53.230 DEBUG: Create: /home/anguyen/.sonar/cache
08:10:53.231 INFO: User cache: /home/anguyen/.sonar/cache
08:10:53.231 DEBUG: Create: /home/anguyen/.sonar/cache/_tmp
08:10:53.233 DEBUG: Extract sonar-scanner-api-batch in tempā¦
08:10:53.237 DEBUG: Get bootstrap indexā¦
08:10:53.237 DEBUG: Download: https://swe-oth-sonarqube-lb-683593332.us-gov-west-1.elb.amazonaws.com/batch/index
08:11:03.297 ERROR: SonarQube server [https://swe-oth-sonarqube-lb-683593332.us-gov-west-1.elb.amazonaws.com] can not be reached
08:11:03.297 INFO: ------------------------------------------------------------------------
08:11:03.297 INFO: EXECUTION FAILURE
08:11:03.297 INFO: ------------------------------------------------------------------------
08:11:03.298 INFO: Total time: 10.399s
08:11:03.307 INFO: Final Memory: 3M/14M
08:11:03.308 INFO: ------------------------------------------------------------------------
08:11:03.308 ERROR: Error during SonarQube Scanner execution
org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarQube
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher$0(IsolatedLauncherFactory.java:85)
at java.base/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.base/java.net.PlainSocketImpl.socketConnect(Native Method)
at java.base/java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.base/java.net.AbstractPlainSocketImpl.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)
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:113)
at org.sonarsource.scanner.api.internal.ServerConnection.downloadString(ServerConnection.java:98)
at org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.getIndex(BootstrapIndexDownloader.java:39)
ā¦ 10 more
Could you suggest what protocols and ports we should open up?
I am not the administrator for the machine where SonarQube is running, so it would be much easier to communicate with our IT department if we have specific requests.
We were able to resolve the network issue, but now run into a scanner issue (stack trace below).
As far as I can tell the wrapper ran correctly.
I was also able to run make on the project and successfully create a .so library from it.
Thank you,
Ai
15:34:06.296 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: The ābuild-wrapper-dump.jsonā file was found but 0 C/C++/Objective-C files were analyzed. Please make sure that:
you are using the latest version of the build-wrapper and the SonarCFamily analyzer
you are correctly invoking the scanner with correct configuration * your compiler is supported
you are wrapping your build correctly
you are wrapping a full/clean build
you are providing the path to the correct build-wrapper output directory
you are building and analyzing the same source checkout, absolute paths must be identical in build and analysis steps
at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:357)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:62)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:386)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:382)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:351)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
could you share the build-wrapper output directory content (build-wrapper.log and build-wrapper-dump.json files) and the sonar-scanner output with -Dsonar.verbose=true property specified?
this compiler call is a linker call, the *.o files are object files, not C source files. In build-wrapper-dump.json I donāt see the call to gcc to compile the *.c files which I can see in the sonar-scanner log:
07:17:31.534 DEBUG: 'Test/geo_test.c' indexed with language 'c'
07:17:31.535 DEBUG: 'Test/time_utils_test.c' indexed with language 'c'
07:17:31.536 DEBUG: 'Test/util_test.c' indexed with language 'c'
07:17:31.537 DEBUG: 'oth_cfg.c' indexed with language 'c'
07:17:31.538 DEBUG: 'oth_errors.c' indexed with language 'c'
07:17:31.539 DEBUG: 'oth_geo.c' indexed with language 'c'
07:17:31.540 DEBUG: 'oth_log.c' indexed with language 'c'
07:17:31.544 DEBUG: 'oth_time_utils.c' indexed with language 'c'
07:17:31.545 DEBUG: 'oth_types.c' indexed with language 'c'
07:17:31.546 DEBUG: 'oth_util.c' indexed with language 'c'
A clean build is a build where all source files are compiled, an incremental build is a build where only modified files are built.
Using the hints from your reply, and also your definition of āclean buildā, I was able to correct our sonar-project.properties and the scan completed successfully.
The problem was I had put sonar-project.properties in the wrong directory and tried scanning from that directory. I moved to the top level of the project and it worked.
Iām closing this issue.
Thanks so much for your help,
Ai