I am attempting to get static analysis done of my code base via SonarQube and when running things locally everything works fine. However when run on the target machine sonar-scanner.bat
fails with the following error:
INFO: Sensor CFamily [cpp]
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:06.930s
INFO: Final Memory: 43M/154M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: S:\
at com.sonar.cpp.jni.FileSystemOperations.realPath(FileSystemOperations.java:56)
at com.sonar.cpp.plugin.AnalysisResultsExporter.<init>(AnalysisResultsExporter.java:56)
at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:211)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:64)
at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:82)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:403)
at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:399)
at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:368)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:137)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
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)
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
Everything above this error looks more or less like a successful run from my local machine.
Now I (obviously) don’t have access to the source code so could someone take a look at this call stack and shed some light on what is going wrong? As stated above I have not been able to reproduce this locally.
Some background information about the environment:
- The project is in C/C++
- The version control being used is ClearCase (target is a dynamic view, local is a static view).
- Both the target and my local machines are windows (target is Win10, local is Win11).
- Both the build wrapper and SonarScanner (v4.7.0.2747) are being downloaded at run time as a zip file, are extracted to some directory, and are executed from the relevant project directory.
I attempted to run the sonar-scanner-debug.bat
file instead on the target machine to see if it would reveal any other useful info, but it looks like the default version of it gets stuck waiting on some TCP connection?
"Executing SonarScanner in Debug Mode"
"SONAR_SCANNER_DEBUG_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"
Listening for transport dt_socket at address: 8000
Build was aborted
I manually aborted the build after about 12 minutes after it started listening on a socket.
If any other info is needed let me know. Thank you!