On a multi-branch project, when I reach 1025 branches, the UI display “An error has occurred. Please contact your administrator” and log showing “too_many_clauses: maxClauseCount is set to 1024”
Version 6.7.6 (build 38781)
Branch plugin 1.0 (build 507)
Caused by: org.elasticsearch.common.io.stream.NotSerializableExceptionWrapper: too_many_clauses: maxClauseCount is set to 1024
sonarqube | at org.apache.lucene.search.BooleanQuery$Builder.add(BooleanQuery.java:125)
sonarqube | at org.apache.lucene.search.BooleanQuery$Builder.add(BooleanQuery.java:138)
sonarqube | at org.elasticsearch.index.query.TermsQueryBuilder.handleTermsQuery(TermsQueryBuilder.java:453)
sonarqube | at org.elasticsearch.index.query.TermsQueryBuilder.doToQuery(TermsQueryBuilder.java:414)
sonarqube | at org.elasticsearch.index.query.AbstractQueryBuilder.toQuery(AbstractQueryBuilder.java:96)
sonarqube | at org.elasticsearch.index.query.BoolQueryBuilder.addBooleanClauses(BoolQueryBuilder.java:444)
sonarqube | at org.elasticsearch.index.query.BoolQueryBuilder.doToQuery(BoolQueryBuilder.java:418)
sonarqube | at org.elasticsearch.index.query.AbstractQueryBuilder.toQuery(AbstractQueryBuilder.java:96)
sonarqube | at org.elasticsearch.index.query.QueryShardContext.lambda$toQuery$1(QueryShardContext.java:313)
sonarqube | at org.elasticsearch.index.query.QueryShardContext.toQuery(QueryShardContext.java:325)
I tried the following settings in sonar.properties
I am working with Bing on this issue, it turns out the auto purge of short live branches stops working. So all inactivity PRs are not removed beyond their retentionn time.
Which log can we lookup?
also we are able to restore our sonarq server from previous day, and able to bring back the ui screen. This is where we find out the PR branches are not purged
also try to switch the retentions between 1 and 3 days do not fix the issue
It will be fixed in 7.7 (SONAR-11439) but in versions before that, only analysis of the master branch triggers housekeeping. Are you (as I suspect) not analyzing the master branch very often? If so, running an analysis should clear out the old PRs and short-lived branches.
We are toasted :(. We no longer use master branch. we have a large source tree with many teams. Every new release rolling out new master-xxx branch. is there any other trick to do the clean up.?
Also we dont plan to upgrade to sonar 7.x unless it is LTS version
Whether or not you use the master branch, all you need to do to make housekeeping kick in is to run an analysis of the project where you do not pass sonar.branch.name. It will be seen as “master” and the housekeeping routines will go to work.