Error during SS executionjava.lang.NullPointerException: Cannot invoke

  • SonarQube version 9.5, dotnet Scanner,
  • Run a new scan on a C# project
  • tried twice and searched a little bit google
    I had run so many times sonarscanner against a C# project where there is no java as follows

dotnet sonarscanner begin…
dotnet build
dotnet sonarscanner end…

All of a sudden, this afternoon, I needed a new analysis, just to check a new quality gateway I added for code smells, when I run the 3rd step it works until it displays the following error (there is absolutly nothing written in java)

INFO: Sensor C# [csharp] (done) | time=294ms
INFO: Sensor Analysis Warnings import [csharp]
INFO: Sensor Analysis Warnings import [csharp] (done) | time=4ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=80ms
INFO: SCM Publisher SCM provider for this project is: git
INFO: SCM Publisher 1 source file to be analyzed
INFO: SCM Publisher 0/1 source files have been analyzed (done) | time=21ms
INFO: ------------------------------------------------------------------------

ERROR: Error during SonarScanner execution
INFO: Final Memory: 15M/68M
java.lang.NullPointerException: Cannot invoke “org.eclipse.jgit.lib.AnyObjectId.hashCode()” because “id” is null
INFO: ------------------------------------------------------------------------
at org.eclipse.jgit.revwalk.RevWalk.parseAny(
at org.eclipse.jgit.revwalk.RevWalk.parseCommit(
at org.sonar.scm.git.CompositeBlameCommand.collectAllCommittedFiles(
at org.sonar.scm.git.CompositeBlameCommand.blame(
at org.sonar.scanner.scm.ScmPublisher.publish(
at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(
at org.sonar.core.platform.SpringComponentContainer.startComponents(
at org.sonar.core.platform.SpringComponentContainer.execute(
at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(
at org.sonar.core.platform.SpringComponentContainer.startComponents(
at org.sonar.core.platform.SpringComponentContainer.execute(
at org.sonar.batch.bootstrapper.Batch.doExecute(
at org.sonar.batch.bootstrapper.Batch.execute(
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(
at java.base/java.lang.reflect.Method.invoke(
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(
at jdk.proxy1/jdk.proxy1.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(
at org.sonarsource.scanner.api.EmbeddedScanner.execute(
at org.sonarsource.scanner.cli.Main.execute(
at org.sonarsource.scanner.cli.Main.execute(
at org.sonarsource.scanner.cli.Main.main(
The SonarScanner did not complete successfully
17:23:03.013 Post-processing failed. Exit code: 1

Hey there.

Thanks for the report. Could you try upgrading to SonarQube v9.6 and see if the issue has resolved itself? We updated the version of JGit used, and made some fixes to the git blame implementation.

Do you mean sonarqube server 9.6? if yes, I run sonarqube as follows

/opt/sonarqube/sonarqube- console

so if I download this new version, I will lose my projects as well as the tokens used by the sonarscanner, am I correct?

I investigated the directory, I can see a “data” directory where it holds embedded database (H2 Database Engine) named Can I copy this to the new 9.6 directory and then everything should be fine? This a a machine where I do POCs for sonarqube, that is why I use the embedded DB