I am running a security scan using the command below, and it fails: Is there a way to get a response to better dig into the issue at hand? I have not found any relevant log entries that help my understanding of what is going wrong.
It returns the following (truncated at the beginning for brevity)
…
13:39:31.709 INFO Available processors: 32
13:39:31.725 INFO Using 32 threads for analysis.
13:39:35.302 INFO Found empty cache on server
13:39:50.436 INFO 755 compilation units to be analyzed, 42 C, 713 CPP
13:39:50.553 INFO Took 110 ms to extract 1 dependencies
13:40:23.234 ERROR Error during SonarScanner Engine execution
java.lang.IllegalStateException:
The compiler execution timed out, make sure that:
* the analysis is running on appropriate hardware
* eventual compiler license check over network is not taking too much time
The executed process:
[C:\Windows\system32\cmd.exe, /c, C:\Users\640635\AppData\Local\Temp\1\vsinclude17474766980424740651.bat]
at com.sonar.cpp.driver.ProcessExecutor.execute(ProcessExecutor.java:59)
at com.sonar.cpp.analyzer.MsvcDriver.getIncludeFromDevCmd(MsvcDriver.java:593)
at com.sonar.cpp.analyzer.AutoScanDependencyHandler.detectMSVC(AutoScanDependencyHandler.java:151)
at com.sonar.cpp.analyzer.AutoScanDependencyHandler.loadLocalHostLibraries(AutoScanDependencyHandler.java:87)
at com.sonar.cpp.analyzer.AutoScanDependencyHandler.loadLibraries(AutoScanDependencyHandler.java:346)
at com.sonar.cpp.plugin.CFamilySensor$AutoScanUtils.getAutoScanActions(CFamilySensor.java:948)
at com.sonar.cpp.plugin.CFamilySensor$AutoScanUtils.fillAutoScanFilesToBeAnalyzed(CFamilySensor.java:895)
at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:605)
at com.sonar.cpp.plugin.CFamilySensor.processConfigurationReader(CFamilySensor.java:521)
at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:240)
at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:186)
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:226)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:201)
at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:197)
at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:170)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
at org.sonar.scanner.bootstrap.SpringScannerContainer.doAfterStart(SpringScannerContainer.java:355)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:144)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
at org.sonar.scanner.bootstrap.ScannerMain.runScannerEngine(ScannerMain.java:149)
at org.sonar.scanner.bootstrap.ScannerMain.run(ScannerMain.java:66)
at org.sonar.scanner.bootstrap.ScannerMain.main(ScannerMain.java:52)
13:40:23.924 INFO EXECUTION FAILURE
13:40:23.936 INFO Total time: 2:17.071s
I see that either my machine is not the correct machine to run it on, or the online check is unable to verify my license is valid. What would cause this, and how could I correct this? Is there any other insight into what could be causing the issue? I have a i9-13950 2.20 GHz Processor with 64 GB of ram, so I do not think it is a lack of compute power.
I have tried opening Developer command prompt for VS 2022, so that the compiler is set up.
Is there anything else I can try to help resolve the issue?
14:31:19.116 INFO Scanner configuration file: C:\Users\640635\Downloads\sonar-scanner-cli-6.2.1.4610-windows-x64\sonar-scanner-6.2.1.4610-windows-x64\bin\..\conf\sonar-scanner.properties
14:31:19.132 INFO Project root configuration file: NONE
14:31:19.148 INFO SonarScanner CLI 6.2.1.4610
14:31:19.164 INFO Java 17.0.12 Eclipse Adoptium (64-bit)
14:31:19.179 INFO Windows 11 10.0 amd64
14:31:19.179 DEBUG Scanner max available memory: 15 GB
14:31:19.211 DEBUG Create: C:\Users\640635\.sonar\cache
14:31:19.211 INFO User cache: C:\Users\640635\.sonar\cache
14:31:19.211 DEBUG Create: C:\Users\640635\.sonar\cache\_tmp
14:31:19.809 DEBUG Successfully loaded KeyStore of the type [Windows-ROOT] having [71] entries
14:31:19.819 DEBUG Failed to load KeyStore of the type [Windows-ROOT-LOCALMACHINE]
14:31:19.903 DEBUG Successfully loaded KeyStore of the type [Windows-ROOT-CURRENTUSER] having [71] entries
14:31:24.344 DEBUG Successfully loaded KeyStore of the type [Windows-MY] having [4] entries
14:31:28.177 DEBUG Successfully loaded KeyStore of the type [Windows-MY-CURRENTUSER] having [4] entries
14:31:28.177 DEBUG Failed to load KeyStore of the type [Windows-MY-LOCALMACHINE]
14:31:28.177 DEBUG Loaded [150] system trusted certificates
14:31:28.454 DEBUG --> GET http://localhost:9010/api/v2/analysis/version
14:31:28.517 DEBUG <-- 200 http://localhost:9010/api/v2/analysis/version (49ms, 13-byte body)
14:31:28.517 INFO JRE provisioning: os[windows], arch[amd64]
14:31:28.517 DEBUG --> GET http://localhost:9010/api/v2/analysis/jres?os=windows&arch=amd64
14:31:28.517 DEBUG <-- 200 http://localhost:9010/api/v2/analysis/jres?os=windows&arch=amd64 (8ms, unknown-length body)
14:31:28.595 DEBUG Executing: C:\Users\640635\.sonar\cache\4bafe2e94439c8193fc8c68247cb0dbaf4e80265b903288f63f128304f129bbe\OpenJDK17U-jre_x64_windows_hotspot_17.0.11_9.zip_extracted\jdk-17.0.11+9-jre\bin\java.exe --version
14:31:29.838 DEBUG openjdk 17.0.11 2024-04-16
14:31:29.838 DEBUG OpenJDK Runtime Environment Temurin-17.0.11+9 (build 17.0.11+9)
14:31:29.851 DEBUG OpenJDK 64-Bit Server VM Temurin-17.0.11+9 (build 17.0.11+9, mixed mode, sharing)
14:31:30.171 DEBUG --> GET http://localhost:9010/api/v2/analysis/engine
14:31:30.171 DEBUG <-- 200 http://localhost:9010/api/v2/analysis/engine (8ms, unknown-length body)
14:31:30.186 INFO Communicating with SonarQube Server 10.8.1.101195
14:31:30.186 DEBUG Work directory: C:\project_stage\ACTIVEold\Code\.scannerwork
14:31:30.186 DEBUG Executing: C:\Users\640635\.sonar\cache\4bafe2e94439c8193fc8c68247cb0dbaf4e80265b903288f63f128304f129bbe\OpenJDK17U-jre_x64_windows_hotspot_17.0.11_9.zip_extracted\jdk-17.0.11+9-jre\bin\java.exe -jar C:\Users\640635\.sonar\cache\f74ac510f3f831dcb27f270d35ddf9245a18b6dc7b22f5f10035726d13b9a63b\scanner-developer-10.8.1.101195-all.jar
14:31:32.072 INFO Starting SonarScanner Engine...
14:31:32.072 INFO Java 17.0.11 Eclipse Adoptium (64-bit)
14:31:32.103 DEBUG JVM max available memory: 15 GB
14:31:32.339 DEBUG Developer 10.8.1.101195
14:31:32.512 DEBUG Sonar User Home: C:\Users\640635\.sonar
14:31:32.715 DEBUG Loading OS trusted SSL certificates...
14:31:32.715 DEBUG This operation might be slow or even get stuck. You can skip it by passing the scanner property 'sonar.scanner.skipSystemTruststore=true'
14:31:33.233 DEBUG Successfully loaded KeyStore of the type [Windows-ROOT] having [71] entries
14:31:33.249 DEBUG Failed to load KeyStore of the type [Windows-ROOT-LOCALMACHINE]
14:31:33.375 DEBUG Successfully loaded KeyStore of the type [Windows-ROOT-CURRENTUSER] having [71] entries
14:31:37.441 DEBUG Successfully loaded KeyStore of the type [Windows-MY] having [4] entries
14:31:41.200 DEBUG Successfully loaded KeyStore of the type [Windows-MY-CURRENTUSER] having [4] entries
14:31:41.200 DEBUG Failed to load KeyStore of the type [Windows-MY-LOCALMACHINE]
14:31:41.200 DEBUG Loaded [150] system trusted certificates
14:31:41.561 INFO Load global settings
14:31:41.577 DEBUG --> GET http://localhost:9010/api/settings/values.protobuf
14:31:41.624 DEBUG <-- 200 http://localhost:9010/api/settings/values.protobuf (52ms, 8081-byte body)
14:31:41.655 INFO Load global settings (done) | time=94ms
So I believe that I have figured out the issue. The VsDevCmd.bat batch file is taking ~1 minute to return successfully due to anti-malware software scanning parts of it as it runs. I am unable to disable these, as they are organizationally imposed by my computer. Is there a way to extend the timeout value for this call?
Currently there isn’t, and the timeout is set at 30 seconds.
Would it be possible to run VsDevCmd.bat just before the scanner, so the antivirus warms up its cache? (I hope it would not scan twice in a row the same set of files?).