Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-10277

Cannot display My Favorites on Projects page if user has more than 1024 projects as favorite

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.7.1
    • Fix Version/s: 7.7
    • Component/s: ElasticSearch, Scalability
    • Labels:
      None
    • Edition:
      Community

      Description

      Description

      When navigating on the global Projects page ('My Favorites' filter), if user has more than 1024 projects as favorites, then the page fails to display any project.

      On the SonarQube server side, following error can be observed in web.log: web.log . Root error being in ElasticSearch:

      Caused by: org.elasticsearch.common.io.stream.NotSerializableExceptionWrapper: too_many_clauses: maxClauseCount is set to 1024
      

      Reproducer:

      • SonarQube 6.7.1
      • quick bash loop to populate the data
        for i in `seq 1 1025`; do curl -u admin:admin -X POST "http://<sonar_url>/api/projects/create?key=boom$i&name=boom$i"; done
        for i in `seq 1 1025`; do curl -u admin:admin -X POST "http://<sonar_url>/api/favorites/add?component=boom$i"; done
        
      • then log-in as admin , go on the Projects page, click on My Favorites
      • no project displayed, error reported in web.log

      Notes:

      • little use-case for having such a high amount of favorite projects (supposed to represent a selected set of projects relevant to the user)
      • there is one use-case where created projects might be automatically flagged as favourite, details in SONAR-8363 (see latest comments)

      Side UI issue
      A 500 is returned by the server under the hood, but no error is made visible to the end-user in the UI. This could be improved, so that user understands that something went bad on server side.

      How to fix

      • The web service that add a project as favorite will fail if the number of favorite projects is already at 100.
      • The analysis will not mark more than 100 projects as favorites, then other projects will be ignored => The use case can happen when a technical account is running the analysis, so there's no need for such account to have projects as favorite.
      • In DB, purge existing favorites to limit to 100 by qualifier, and remove all remaining ones

        Attachments

        1. web.log
          556 kB
          Nicolas Bontoux

          Activity

            People

            • Assignee:
              julien.lancelot Julien Lancelot
              Reporter:
              nicolas.bontoux Nicolas Bontoux
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: