All projects show 'Execution success' on soanr-scanner but failed on Background Tasks

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Sonarqube enterprise edition 9.8
    postgresql 15.1 in docker

  • what are you trying to achieve
    After the successful sonar-scanner analysis, I can see the results on sonarqube.

  • what have you tried so far to achieve this
    I used sonarqube’s C++ sample project, but it still showed background task failed.

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

error.txt (4.7 KB)

Hey there.

It looks like the error relates to a metric provided by the community supported sonar-cxx plugin.

Caused by: java.lang.IllegalStateException: Metric with key 'CXX-public_undocumented_api' does not exist
	at org.sonar.ce.task.projectanalysis.metric.MetricRepositoryImpl.getByKey(
	at org.sonar.ce.task.projectanalysis.api.measurecomputer.MeasureComputerContextImpl.getMeasure(
	at org.sonar.cxx.DensityMeasureComputer.compute(
	at org.sonar.cxx.DensityMeasureComputer.compute(
	at org.sonar.ce.task.projectanalysis.measure.MeasureComputersVisitor.visitAny(
	at org.sonar.ce.task.projectanalysis.component.TypeAwareVisitorWrapper.visitAny(
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitNode(
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitImpl(
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(
	... 35 more

I would suggest uninstalling this plugin to see if the issue resolves itself, and raising an issue with the maintainer

I changed the environment’s JDK from jdk17 to jdk11. Then I analyzed the java sample project and it worked. Finally, I analyzed the C++ sample project, which was also successful.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.