Re-upload sonar analysis to sonar server

Hello ,

Problem summary : Is it possible to re-upload the sonar results of previous execution?


I am using sonarqube 7.9.2 community edition
I have a huge repo and I ran sonarqube gradle analysis. But at the end I’ve noticed an errror

Execution failed for task ‘:sonarqube’.

Fail to request https:///api/ce/submit?projectKey=myprojectkey&projectName=project1

I realised i have a network issue and I have a few ideas that could solve it, but the problem is I have to do the client side analysis every time I try a workaround for this network issue(each sonar analysis run takes more than 11 hours ). Is there any way I can simply re-upload the previous sonar analysis result and get around the wait time?

I found this question which says it is not possible. But this is considerably old so I want to know if there are any latest improvements on this

As you saw on stackoverflow thread it is not possible to re-submit a report of a failed analysis.

It might help to check access.log of SonarQube to see if api/ce/submit request reached it and web.log for potential errors.

If the issue is network related what could help you in testing is posting a dummy report with the size similar to the original one e.g.:
Originally zipped report is 10m:

INFO: Analysis report generated in 224ms, dir size=50 MB
INFO: Analysis report compressed in 808ms, zip size=10 MB

You can create a dummy report with a similar size and post it to SonarQube with curl:

$ truncate -s 10M
$ curl -X POST -u <user>:<pass> "http://localhost:9000/api/ce/submit?projectKey=dummy&projectName=dummy" -F ";type=application/zip"

This should help you to confirm that a report of a given size can reach SonarQube via network from the scanner side.