I am trying to add a coverage report for a Python project via the -Dsonar.python.coverage.reportPaths= argument. Sonar-scanner uploads the report fine, but then the Background Task running the analysis seems to hang[*] and I have to restart the service. I’ve tried this several times, and the behavior is repeatable.
I am unable to recreate this problem locally - I downloaded the community edition zip (v25.2.0) and was able to analyze the project just fine. This issue seems to only exist on our production server.
I have been able to upload a coverage report for a smaller subset of tests, but a larger set of tests causes this issue. I’m unsure if it’s related to the size of the coverage report or if the resulting coverage report is somehow malformed. My failing uploaded coverage report is ~14MB, but we upload larger reports for another project (although that other project has significantly fewer SLOC).
I’ve downloaded the Compute Engine logs for the hanging task, and the last line in the logs is always: Compute duplication measures | status=SUCCESS | time=15ms
[*] I’ve let it run for 10 minutes before restarting the service. It’s our production server, so I can’t let it run much longer than that without interrupting service.
The issue has appeared on both SonarQube server v10.6 and v2025.1 (102418) using SonarQube Developer Edition. SonarQube is deployed from zip and connects to a Postgres 13 database. Sonar-scanner is CLI 6.1.0.4477 with Java 17.0.11.
That’s pretty unexpected behavior. The next step after Computing Duplication Measures has nothing to do with coverage (it’s Compute size measures on new code), so the fact that supplying a coverage report (even a large one) causes there to be an issue is pretty weird.
I have a few thoughts:
With the v25.2 Community Build, are you connecting it to your Postgres database or just using the embedded H2 database?
Could you double check your scanner logs to see if the coverage report is being indexed by the scanner? You can see every individual file indexed by the scanner by executing sonar-scanner -X.
If you see it being indexed, I would suggest excluding the file from analysis (sonar.exclusions) to see if that changes the behavior.
Should DB maintenance is never a bad idea.
Do you see any significant load (CPU, memory) on either your SonarQube server or your database when this happens?
Hi Colin,
I think the issue was that the coverage report was getting indexed. Since it was in a test folder I excluded the XML via the sonar.test.exclusions argument. That seems to have fixed the issue.
Thanks!