SonarQube version: 7.9.1
To ensure a Sonar issue report is available we poll the project_analysis API with: /api/project_analyses/search?project={projectId}
If this analysis search receives at least one result the report should be available:
{"paging":{"pageIndex":1,"pageSize":100,"total":1},"analyses":[{"key":"projectId", ......}], ......}
With /api/issues/search?componentKeys={projectId}
we download the report for this specific project. The report should be available because the project_analysis API told us the analysis is available.
In most cases that is true and the first download is filled with all the issues.
But unfortunately - on very rare cases - the first report download is “empty”:
{"total":0,"p":1,"ps":100,"paging":{"pageIndex":1,"pageSize":100,"total":0},"effortTotal":0,"debtTotal":0,"issues":[],"components":[],"facets":[]}
Only the second download and all further attempts are filled.
There seems to be a timely issue between “the analysis is available” and “the report is available”.