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(MetricRepositoryImpl.java:67)
	at org.sonar.ce.task.projectanalysis.api.measurecomputer.MeasureComputerContextImpl.getMeasure(MeasureComputerContextImpl.java:112)
	at org.sonar.cxx.DensityMeasureComputer.compute(DensityMeasureComputer.java:72)
	at org.sonar.cxx.DensityMeasureComputer.compute(DensityMeasureComputer.java:120)
	at org.sonar.ce.task.projectanalysis.measure.MeasureComputersVisitor.visitAny(MeasureComputersVisitor.java:65)
	at org.sonar.ce.task.projectanalysis.component.TypeAwareVisitorWrapper.visitAny(TypeAwareVisitorWrapper.java:77)
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitNode(VisitorsCrawler.java:114)
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:97)
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:69)
	... 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.