Must-share information (formatted with Markdown):
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
- what are you trying to achieve
- what have you tried so far to achieve this
Must-share information (formatted with Markdown):
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
- what are you trying to achieve
- what have you tried so far to achieve this
I use sonar scanner v3.0.2.656 to scan one of the .NET project. I have upgraded the JDK from Oracle jre1.8.0_181 to RedHat Open JDK 1.8.0.265 on Jenkins agent running on a Windows machine.
The connection between sonar scanner (running on Windows agent) and SonarQube server was fine until I upgraded JDK. I have correctly configured the JAVA_HOME path and imported self signed certificates in both JAVA cacers and sonarscanner cacert path. I’ve checked the Jenkins agent.xml and found that it is pointing to the correct JDK version.
The scanner is failing after the upgrade and error indicate that the scanner is still pointing to cacerts of old Java version (prior to upgrade).
INFO: Scanner configuration file: D:\sonar-scanner-msbuild-3.0.2.656\sonar-scanner-3.0.3.778\bin\..\conf\sonar-scanner.properties
INFO: SonarQube Scanner 3.0.3.778
INFO: Java 1.8.0_265 Red Hat, Inc. (64-bit)
INFO: Windows Server 2016 10.0 amd64
INFO: SONAR_SCANNER_OPTS=-Djavax.net.ssl.trustStore="xxxx\jre1.8.0_181\lib\security\cacerts" -Djavax.net.ssl.keyStore="xxxx\jre1.8.0_181\lib\security\cacerts"
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 0.456s
INFO: Final Memory: 4M/245M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Unable to initialize key manager
at org.sonarsource.scanner.api.internal.OkHttpClientFactory.getDefaultKeyManager(OkHttpClientFactory.java:155)
at org.sonarsource.scanner.api.internal.OkHttpClientFactory.systemDefaultSslSocketFactory(OkHttpClientFactory.java:103)
at org.sonarsource.scanner.api.internal.OkHttpClientFactory.create(OkHttpClientFactory.java:71)
at org.sonarsource.scanner.api.internal.ServerConnection.<init>(ServerConnection.java:51)
at org.sonarsource.scanner.api.internal.ServerConnection.create(ServerConnection.java:61)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:64)
at org.sonarsource.scanner.api.EmbeddedScanner.doStart(EmbeddedScanner.java:218)
at org.sonarsource.scanner.api.EmbeddedScanner.start(EmbeddedScanner.java:156)
at org.sonarsource.scanner.cli.Main.execute(Main.java:74)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.io.FileNotFoundException: xxxx\jre1.8.0_181\lib\security\cacerts (The system cannot find the path specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:93)
at org.sonarsource.scanner.api.internal.OkHttpClientFactory.initKeyStore(OkHttpClientFactory.java:170)
at org.sonarsource.scanner.api.internal.OkHttpClientFactory.getDefaultKeyManager(OkHttpClientFactory.java:138)
... 9 more
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
The SonarQube Scanner did not complete successfully
00:57:23.189 Creating a summary markdown file...
00:57:23.2 Post-processing failed. Exit code: 1
Can anyone please help me understand why sonar scanner is still pointing to old Java version and how can I change it to point to the new java version ?
Appreciate your help and attention !