NullPointerException when sending to SonarCloud

Hi!
When we are sending info to SonarCloud we have this error:

java.lang.NullPointerException
	at com.sonar.cpp.N.A.A(na:2528)
	at com.sonar.cpp.N.A.A(na:1834)
	at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1138)
	at com.sonar.cpp.N.A.A(na:2468)
	at com.sonar.cpp.N.A.A(na:2506)
	at com.sonar.cpp.plugin.R.A(na:3517)
	at com.sonar.cpp.plugin.R.execute(na:1072)
	at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:45)
	at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:88)
	at org.sonar.scanner.phases.SensorsExecutor.lambda$execute$1(SensorsExecutor.java:65)
	at org.sonar.scanner.phases.SensorsExecutor.withGlobalStrategy(SensorsExecutor.java:80)
	at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:65)
	at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:74)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:164)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:319)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:314)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:288)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
	at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:82)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:131)
	at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:71)
	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(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	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:171)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:128)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:111)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)

¿Any idea?

Hello Miquel,

Could you please send us the full logs (including build wrapper logs), because it’s hard to get an idea just with this information?

By the way, could you also make sure that the version of build wrapper you use matches the CFamily plugin (you can do that just by downloading it from the server). This issue might be linked to the use of an outdated version of this tool.

Thank you,

I think the problem is trying to send data to Github Pull Request, because if we launch a complete scan it works fine.

Hello,

For your information Github Pull Request analysis makes you able to decorate Github pull requests. It does not make you able to analyze a peace of your project. Whatever if you are using this plugin or not, you should build and analyze the entire project.

If the problem persist when you are using n Github Pull Request analysis even if you are running a full build and analysis of the project, thank you for reproducing and for providing:

  • the logs of the scanner (console logs that are printed during the analysis)
  • the build-wrapper outputs (all that is included in the folder you are using to run the build wrapper)

JD.