Dotnet sonarscanner end fails to upload analysis

After upgrading our SonarQube Server to version ‘Developer Edition v2025.2 (105476)’ the ‘dotnet sonarscanner end…’ process fails.
The output says indicates there’s an Illegal char < > in the truststore.p12 which seems odd since this truststore was working prior to the upgrade and has not changed.
The truststore.p12 was created by sonarlint using Visual Studio 2022 IDE which set the password to ‘sonarlint’ instead of ‘sonar’ or ‘changeit’.

The ‘dotnet sonarscanner begin…’ process runs successfully but says the remote server certificate is trusted and the “Provided truststore was not used.”

Below is part of the stacktrace.
Any thoughts or suggestions is greatly appreciated.

11:03:36.946 ERROR: Error during SonarScanner execution
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.sonarsource.scanner.api.internal.IsolatedClassloader@6a192cfe-org.sonar.scanner.bootstrap.ScannerPluginRepository’: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name ‘org.sonarsource.scanner.api.internal.IsolatedClassloader@6a192cfe-org.sonar.scanner.bootstrap.ScannerPluginInstaller’: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name ‘org.sonarsource.scanner.api.internal.IsolatedClassloader@6a192cfe-org.sonar.scanner.bootstrap.PluginFiles’: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name ‘DefaultScannerWsClient’ defined in org.sonar.scanner.http.ScannerWsClientProvider: Failed to instantiate [org.sonar.scanner.http.DefaultScannerWsClient]: Factory method ‘provide’ threw exception with message: Illegal char < > at index 27: C:Usersboblinn.sonarlintsslruststore.p12
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:804)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:240)

I have tried uninstalling Sonar from Visual Studio 2022 IDE, removing the .sonarlint/ssl/truststore.p12, re-installing Sonar in the IDE and re-generating a new truststore.p12 after re-binding to the project on our SonarQube Server. The results are the same indicating an error with the truststore.p12.

Continuing the discussion from Failed to import the sonar.scanner.truststorePath:

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension)
  • how is SonarQube deployed: zip, Docker, Helm
  • what are you trying to achieve
  • what have you tried so far to achieve this

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

I believe I’ve resolved the issue.
It seems on a Windows platform the ‘Path.Of()’ method does not like backslashes (‘\’) in the path.
In the sonar-scanner.properties I changed the property ‘sonar.scanner.truststorePath’ from C:\Users\boblinn\.sonarlint\ssl\truststore.p12 to C:/Users/boblinn/.sonarlint/ssl/truststore.p12 and the ‘dotnet sonarscanner end…’ now works.
The ‘Path.Of()’ is used in org.sonar.scanner.http.ScannerWsClientProvider Line 148: var trustStore = new CertificateStore(Path.of(trustStorePath), trustStorePassword);

The hint came from the answer in this: https://stackoverflow.com/questions/77123774/string-of-java-nio-file-path

Thank you.

1 Like