We are using sonarqube 9.5 (build 56709) developer edition, but have seen this problem on earlier versions.
I want to drill down to the details of the issues that sonarqube has found
With almost all of our projects we have branches that when viewed in the sonarqube UI, show counts greater than zero for bugs, vulnerabilities or code smells on the overview tab of that project (either under ‘new code’ or ‘overall code’), but that don’t show any issues when you click through on one of these counts to the ‘issues’ tab. Even clearing all filters will not show any, and the ‘No issues. Hooray!’ is shown instead.
Something similar happens when I go through the ‘code’ tab. As long as I am in the table view of my files and directories there are counts greater than zero, but as soon as I hit a specific file that according to these counts does have issues, they don’t show up in the source code view.
Does anyone recognize this or better still knows what is going on and how to fix this ?
Could one of you do one of the click-thrus where the issues a missing & check the developer tools to see if there are errors in either the console or the network tab?
The only error is a 404 on a call to the path ‘/sonar/api/alm_settings/get_binding?project=xxx’ where xxx is the projectkey. The response contains {“errors”:[{“msg”:“Project \u0027xxx\u0027 is not bound to any ALM”}]} with again xxx instead of the project key.
Calls to the path ‘/sonar/api/issues/search’ return json with an empty array as value for the ‘issues’ in the error case and an array with the same number of records as the issue count otherwise.
Hi,
Yes, performing a new analysis will fix the problem. However, I haven’t been able to figure out a pattern for after how much time the problem starts to show up.
By the way, the issue counts are always correct as far as I can tell: it is in the ‘issues’ and ‘code’ tabs that issues are not shown. The following screenshots should illustrate this.
Recent analysis with issues and what is shown after I click through to the 4 bugs (so this is working as expected):
Something similar occurs with the ‘code’ view. For brevity I only show the case when the problem occurs. The class Sleeper.java has a code smell (Thread.sleep() ), but it is not shown when I click through to the code.
Hi Marcel,
Since it looks like it’s a small project, maybe you could run a DB query to see what issues are actually stored, so that we can figure out if the problem is related to indexing.
If you can, when experiencing the problem please run:
SELECT * FROM ISSUES i, projects p, PROJECT_BRANCHES pb
WHERE i.PROJECT_UUID = pb."UUID" AND pb.PROJECT_UUID = p."UUID"
AND p.KEE = '{project key}'
AND pb.KEE = '{branch or PR key}'
Note that it will return all issues in the branch, so it’s only effective for projects with a very low number of issues, like the one you showed in the screenshot.
Hi, the output looks good, so it looks like there’s something wrong with the elastic search index.
Did you check the logs of all 3 processes (es.log, web.log, ce.log) to see if there are any errors? Specially in the es.log.
Also was the problem at least temporarily fixed when you follow Ann’s procedure of removing data/es7 and waiting a bit after restart for SQ to reindex all the data?