Issue with Java and sonar scanner scans after upgrading to sonarqube 2025.2 from 10.8

version of SQ: 2025.2 Server
deployed with .zip

We have 15 build servers where the scans are ran. After the upgrade to a newest version of SQ the scans of Java projects (used via Maven) and the ones directly ran from Sonar Scanner CLI are crashing. We are using azure devops to run the scans - tried with both task v7 and task v6 - same results.

Below the logs of the crash.

We tried to clean the .cache folder. The user is an admin and has the read/write permissions to the folder. We ran the scan using built in JDK versions (both 17 and 21) and JAVA_HOME set to 21 - All this to no vein on those 12 servers. We are trying to pinpoint if there is any difference in the 3 servers that are working but for now we couldnt find any..

Any suggestions what we can check or what might it be would be greatly appreciated.

Logs:

2025-05-14T05:36:09.4392121Z ##[section]Starting: Run Code Analysis
2025-05-14T05:36:09.4398422Z ==============================================================================
2025-05-14T05:36:09.4398538Z Task         : Run Code Analysis
2025-05-14T05:36:09.4398605Z Description  : Run scanner and upload the results to the SonarQube Server.
2025-05-14T05:36:09.4398692Z Version      : 7.3.0
2025-05-14T05:36:09.4398742Z Author       : sonarsource
2025-05-14T05:36:09.4398802Z Help         : This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.

[More Information](https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/scanners/sonarqube-extension-for-azure-devops/)
2025-05-14T05:36:09.4399029Z ==============================================================================
2025-05-14T05:36:09.7617551Z [command]C:\Windows\system32\cmd.exe /D /S /C "D:\ADO\A1\w\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\7.3.0\sonar-scanner\bin\sonar-scanner.bat"
2025-05-14T05:36:11.0999346Z 07:36:11.078 INFO  Scanner configuration file: D:\ADO\A1\w\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\7.3.0\sonar-scanner\bin\..\conf\sonar-scanner.properties
2025-05-14T05:36:11.1087642Z 07:36:11.094 INFO  Project root configuration file: NONE
2025-05-14T05:36:11.1449903Z 07:36:11.141 INFO  SonarScanner CLI 7.1.0.4889
2025-05-14T05:36:11.1466076Z 07:36:11.141 INFO  Java 21.0.2 Red Hat, Inc. (64-bit)
2025-05-14T05:36:11.1501815Z 07:36:11.141 INFO  Windows Server 2022 10.0 amd64
2025-05-14T05:36:11.1662905Z 07:36:11.157 DEBUG Scanner max available memory: 6 GB
2025-05-14T05:36:11.2008803Z 07:36:11.188 DEBUG Using JVM default truststore: D:\webtek\java\redhat_jdk21u0.2.0.13-2\lib\security\cacerts
2025-05-14T05:36:11.2023128Z 07:36:11.188 DEBUG Create: C:\Users\pi9995_tfs_build\.sonar\cache
2025-05-14T05:36:11.2029343Z 07:36:11.188 INFO  User cache: C:\Users\pi9995_tfs_build\.sonar\cache
2025-05-14T05:36:11.2031919Z 07:36:11.188 DEBUG Create: C:\Users\pi9995_tfs_build\.sonar\cache\_tmp
2025-05-14T05:36:11.4594851Z 07:36:11.453 DEBUG Loading OS trusted SSL certificates...
2025-05-14T05:36:11.4595527Z 07:36:11.453 DEBUG This operation might be slow or even get stuck. You can skip it by passing the scanner property 'sonar.scanner.skipSystemTruststore=true'
2025-05-14T05:36:11.6232328Z 07:36:11.610 DEBUG Successfully loaded KeyStore of the type [Windows-ROOT] having [63] entries
2025-05-14T05:36:11.6679912Z 07:36:11.657 DEBUG Successfully loaded KeyStore of the type [Windows-ROOT-LOCALMACHINE] having [63] entries
2025-05-14T05:36:11.7104225Z 07:36:11.703 DEBUG Successfully loaded KeyStore of the type [Windows-ROOT-CURRENTUSER] having [63] entries
2025-05-14T05:36:11.7722986Z 07:36:11.766 DEBUG Successfully loaded KeyStore of the type [Windows-MY] having [0] entries
2025-05-14T05:36:11.7890753Z 07:36:11.782 DEBUG Successfully loaded KeyStore of the type [Windows-MY-CURRENTUSER] having [0] entries
2025-05-14T05:36:11.8278614Z 07:36:11.813 DEBUG Successfully loaded KeyStore of the type [Windows-MY-LOCALMACHINE] having [3] entries
2025-05-14T05:36:11.8323546Z 07:36:11.828 DEBUG Loaded [192] system trusted certificates
2025-05-14T05:36:12.1412453Z 07:36:12.125 DEBUG Loaded truststore from 'D:\webtek\java\redhat_jdk21u0.2.0.13-2\lib\security\cacerts' containing 127 certificates
2025-05-14T05:36:12.7996412Z 07:36:12.797 DEBUG --> GET https://sonarqube.sdc.dk/api/v2/analysis/version
2025-05-14T05:36:13.1761473Z 07:36:13.175 DEBUG <-- 200 https://sonarqube.sdc.dk/api/v2/analysis/version (376ms, 15-byte body)
2025-05-14T05:36:13.1804852Z 07:36:13.179 INFO  Communicating with SonarQube Server 2025.2.0.105476
2025-05-14T05:36:13.1813579Z 07:36:13.179 INFO  JRE provisioning: os[windows], arch[amd64]
2025-05-14T05:36:13.1818173Z 07:36:13.179 DEBUG --> GET https://sonarqube.sdc.dk/api/v2/analysis/jres?os=windows&arch=amd64
2025-05-14T05:36:13.1933874Z 07:36:13.179 DEBUG <-- 200 https://sonarqube.sdc.dk/api/v2/analysis/jres?os=windows&arch=amd64 (11ms, unknown-length body)
2025-05-14T05:36:14.6765253Z 07:36:14.663 INFO  EXECUTION FAILURE
2025-05-14T05:36:14.6773677Z 07:36:14.663 INFO  Total time: 3.663s
2025-05-14T05:36:14.6837091Z ##[error]07:36:14.663 ERROR Error during SonarScanner CLI execution
java.lang.IllegalStateException: Failed to extract archive
	at org.sonarsource.scanner.lib.internal.facade.forked.JavaRunnerFactory.extractArchive(JavaRunnerFactory.java:202)
	at org.sonarsource.scanner.lib.internal.facade.forked.JavaRunnerFactory.getJreFromServer(JavaRunnerFactory.java:147)
	at org.sonarsource.scanner.lib.internal.facade.forked.JavaRunnerFactory.createRunner(JavaRunnerFactory.java:87)
	at org.sonarsource.scanner.lib.internal.facade.forked.ScannerEngineLauncherFactory.createLauncher(ScannerEngineLauncherFactory.java:54)
	at org.sonarsource.scanner.lib.ScannerEngineBootstrapper.buildNewFacade(ScannerEngineBootstrapper.java:197)
	at org.sonarsource.scanner.lib.ScannerEngineBootstrapper.bootstrapServer(ScannerEngineBootstrapper.java:177)
	at org.sonarsource.scanner.lib.ScannerEngineBootstrapper.bootstrap(ScannerEngineBootstrapper.java:151)
	at org.sonarsource.scanner.cli.Main.analyze(Main.java:76)
	at org.sonarsource.scanner.cli.Main.main(Main.java:64)
Caused by: java.nio.file.AccessDeniedException: C:\Users\pi9995_tfs_build\.sonar\cache\11a61a94d383e755b08b4e5890a13d148bc9f95b7149cbbeec62efb8c75a4a67\jre13603350624824752674 -> C:\Users\pi9995_tfs_build\.sonar\cache\11a61a94d383e755b08b4e5890a13d148bc9f95b7149cbbeec62efb8c75a4a67\OpenJDK17U-jre_x64_windows_hotspot_17.0.13_11.zip_extracted
	at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
	at java.base/sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:414)
	at java.base/sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:291)
	at java.base/java.nio.file.Files.move(Files.java:1430)
	at org.sonarsource.scanner.lib.internal.facade.forked.JavaRunnerFactory.extractArchive(JavaRunnerFactory.java:196)
	... 8 common frames omitted
2025-05-14T05:36:14.6845818Z 07:36:14.663 ERROR Error during SonarScanner CLI execution
2025-05-14T05:36:14.6846005Z java.lang.IllegalStateException: Failed to extract archive
2025-05-14T05:36:14.6846280Z 	at org.sonarsource.scanner.lib.internal.facade.forked.JavaRunnerFactory.extractArchive(JavaRunnerFactory.java:202)
2025-05-14T05:36:14.6846624Z 	at org.sonarsource.scanner.lib.internal.facade.forked.JavaRunnerFactory.getJreFromServer(JavaRunnerFactory.java:147)
2025-05-14T05:36:14.6846905Z 	at org.sonarsource.scanner.lib.internal.facade.forked.JavaRunnerFactory.createRunner(JavaRunnerFactory.java:87)
2025-05-14T05:36:14.6847229Z 	at org.sonarsource.scanner.lib.internal.facade.forked.ScannerEngineLauncherFactory.createLauncher(ScannerEngineLauncherFactory.java:54)
2025-05-14T05:36:14.6847601Z 	at org.sonarsource.scanner.lib.ScannerEngineBootstrapper.buildNewFacade(ScannerEngineBootstrapper.java:197)
2025-05-14T05:36:14.6847917Z 	at org.sonarsource.scanner.lib.ScannerEngineBootstrapper.bootstrapServer(ScannerEngineBootstrapper.java:177)
2025-05-14T05:36:14.6848189Z 	at org.sonarsource.scanner.lib.ScannerEngineBootstrapper.bootstrap(ScannerEngineBootstrapper.java:151)
2025-05-14T05:36:14.6848456Z 	at org.sonarsource.scanner.cli.Main.analyze(Main.java:76)
2025-05-14T05:36:14.6848678Z 	at org.sonarsource.scanner.cli.Main.main(Main.java:64)
2025-05-14T05:36:14.6849455Z Caused by: java.nio.file.AccessDeniedException: C:\Users\pi9995_tfs_build\.sonar\cache\11a61a94d383e755b08b4e5890a13d148bc9f95b7149cbbeec62efb8c75a4a67\jre13603350624824752674 -> C:\Users\pi9995_tfs_build\.sonar\cache\11a61a94d383e755b08b4e5890a13d148bc9f95b7149cbbeec62efb8c75a4a67\OpenJDK17U-jre_x64_windows_hotspot_17.0.13_11.zip_extracted
2025-05-14T05:36:14.6849904Z 	at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89)
2025-05-14T05:36:14.6850179Z 	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
2025-05-14T05:36:14.6851218Z 	at java.base/sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:414)
2025-05-14T05:36:14.6851496Z 	at java.base/sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:291)
2025-05-14T05:36:14.6851779Z 	at java.base/java.nio.file.Files.move(Files.java:1430)
2025-05-14T05:36:14.6852005Z 	at org.sonarsource.scanner.lib.internal.facade.forked.JavaRunnerFactory.extractArchive(JavaRunnerFactory.java:196)
2025-05-14T05:36:14.6852267Z 	... 8 common frames omitted
2025-05-14T05:36:14.6852991Z ##[error]07:36:14.679 ERROR 
07:36:14.679 ERROR Re-run SonarScanner CLI using the -X switch to enable full debug logging.
2025-05-14T05:36:14.6853487Z 07:36:14.679 ERROR 
2025-05-14T05:36:14.6853932Z 07:36:14.679 ERROR Re-run SonarScanner CLI using the -X switch to enable full debug logging.
2025-05-14T05:36:15.2514899Z ##[error][ERROR] SonarQube Server: Error while executing task Analyze: The process 'D:\ADO\A1\w\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\7.3.0\sonar-scanner\bin\sonar-scanner.bat' failed with exit code 1
2025-05-14T05:36:15.2516268Z ##[error]The process 'D:\ADO\A1\w\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\7.3.0\sonar-scanner\bin\sonar-scanner.bat' failed with exit code 1
2025-05-14T05:36:15.2603307Z ##[section]Finishing: Run Code Analysis

Hello,
Not that is a solution for your problem, but when you set the variable JAVA_HOME to use the specific JDK/JRE, have you set the parameter sonar.scanner.skipJreProvisioning to true? Can you provide the logs when you try to not using the Embedded JRE?
Hope this helps.

1 Like

Wow @mvillanueva thanks a lot !! it did a trick. If you can elaborate why using the sonnar provisioned jre is an issue , that would be awesome. I thought that the gap in Sonar provisioned jre certificate was closed , i think it was cert related ?

The solution I suggested was intended to make the your system work, however, the automatic provision of jre is here to help, so I believe it is the preferred configuration (for instance, in terms of maintainability).
I believe you should be trying to solve the problem you have in the logs. It seems to be a folder permission… it won’t be the first time I find myself with the same problem in windows with all the permissions granted and still not working. I suggest you go deep in this matter trying somehow recreate that folder so it is writable by sonar.
Good luck. :slight_smile: