Sonar Scanner in window server 2016

Template for a good bug report, formatted with Markdown:

  • versions used (SonarQube 8.2, sonar-scanner-cli-4.2.0.1873-windows)
  • Error:
06:32:05.988 INFO: Scanner configuration file: D:\sonarscanner\sonar_scanner\bin\..\conf\sonar-scanner.properties
06:32:06.003 INFO: Project root configuration file: D:\trailhead-code-samples-master\sonar-project.properties
06:32:06.034 INFO: SonarQube Scanner 4.2.0.1873
06:32:06.034 INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
06:32:06.034 INFO: Windows Server 2016 10.0 amd64
06:32:06.191 DEBUG: keyStore is :
06:32:06.191 DEBUG: keyStore type is : pkcs12
06:32:06.191 DEBUG: keyStore provider is :
06:32:06.191 DEBUG: init keystore
06:32:06.191 DEBUG: init keymanager of type SunX509
06:32:06.378 DEBUG: Create: C:\Users\gajulm3!\.sonar\cache
06:32:06.378 INFO: User cache: C:\Users\gajulm3!\.sonar\cache
06:32:06.378 DEBUG: Create: C:\Users\gajulm3!\.sonar\cache\_tmp
06:32:06.378 DEBUG: Extract sonar-scanner-api-batch in temp...
06:32:06.394 DEBUG: Get bootstrap index...
06:32:06.394 DEBUG: Download: http://localhost:9000/sonar/batch/index
06:32:06.472 DEBUG: Get bootstrap completed
06:32:06.472 DEBUG: Create isolated classloader...
06:32:06.490 DEBUG: Start temp cleaning...
06:32:06.490 DEBUG: Temp cleaning done
06:32:06.490 DEBUG: Execution getVersion
06:32:06.506 INFO: SonarQube server null
06:32:06.506 INFO: Default locale: "en_US", source code encoding: "UTF-8"
06:32:06.506 DEBUG: Work directory: D:\trailhead-code-samples-master\.scannerwork
06:32:06.506 DEBUG: Execution execute
06:32:06.521 INFO: ------------------------------------------------------------------------
06:32:06.521 INFO: EXECUTION FAILURE
06:32:06.521 INFO: ------------------------------------------------------------------------
06:32:06.521 INFO: Total time: 0.549s
06:32:06.552 INFO: Final Memory: 3M/14M
06:32:06.552 INFO: ------------------------------------------------------------------------
06:32:06.568 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalArgumentException: Logback configuration not found in classloader: /org/sonar/batch/bootstrapper/logback.xml
        at org.sonar.core.config.Logback.configure(Logback.java:49)
        at org.sonar.batch.bootstrapper.LoggingConfigurator.apply(LoggingConfigurator.java:50)
        at org.sonar.batch.bootstrapper.LoggingConfigurator.apply(LoggingConfigurator.java:46)
        at org.sonar.batch.bootstrapper.Batch.configureLogging(Batch.java:128)
        at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:70)
        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)

We are facing error with sonar scanner, below are the details

  1. Installed latest SonarQube on window server 2016. The web console is up and running.

  2. Sonarscanner also configured on the same machine. Tested scanner with sample code and Its failing. Attached error log in the above.

  3. To debug

  4. Configured sonar scanner on windows 10 machines and it’s working fine. Able to see the analysis report on the sonarqube dashboard.

  5. Configured sonar scanner on another windows server 2016 VM and same error.

I thought, its issue with windows server 2016. I tried with windows server 2016 on AWS. Configured sonar scanner with sonarcloud and its working.

**ERROR:**

06:32:06.490 DEBUG: Execution getVersion

06:32:06.506 INFO: SonarQube server null

the getVersion is not returning the sonarqube server version. Looks like, its failing this step.

Could you please help us on this.

Thanks,

Mohan Raja

Hi,

Welcome to the community!

I find this portion of your initial log interesting:

If I look at what’s returned for that path on our internal SonarQube instance, I get this:
scanner-datacenter-8.4.0.34241-all.jar|46b935fcd5430b05464f4bd29b30d065

As you see, it includes the server version, which is likely parsed out by

So I suspect that what’s being returned to your process isn’t in the expected format. Which brings me to this part of your log:

Specifically, the “localhost” part. Is SonarQube actually running on the same server as analysis? If not, then you need to at minimum pass the SonarQube server location on the analysis command line with -Dsonar.host.url=[url].

 
HTH,
Ann

I found the root cause, the scanner running windows user contains a special character(ex: Use name: gajm3!) that why it’s not able to Execution getVersion.

the issue was reproduced on the windows 10 VM also.

Are planning to fix the issue on the scanner.?

Hi,
This is caused by an old bug in Java that remains unsolved because URLs are not quoted.

See this report and related tickets:
https://bugs.openjdk.java.net/browse/JDK-4730642

The workaround is obviously to not use ! in paths.

1 Like