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

SonarQube is not starting when in need of issues indexing

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 8.4
    • Fix Version/s: 8.4.1, 8.5
    • Component/s: ElasticSearch
    • Labels:
      None
    • Edition:
      Community
    • Production Notes:
      None

      Description

      This issue was raised by the community, and under certain circumstances, SonarQube won't start with the following error:

      java.lang.IllegalArgumentException: Comparison method violates its general contract!
              at java.base/java.util.TimSort.mergeLo(TimSort.java:781)
              at java.base/java.util.TimSort.mergeAt(TimSort.java:518)
              at java.base/java.util.TimSort.mergeCollapse(TimSort.java:448)
              at java.base/java.util.TimSort.sort(TimSort.java:245)
              at java.base/java.util.Arrays.sort(Arrays.java:1515)
              at java.base/java.util.ArrayList.sort(ArrayList.java:1749)
              at org.sonar.server.issue.index.AsyncIssueIndexingImpl.sortProjectUuids(AsyncIssueIndexingImpl.java:104)
              at org.sonar.server.issue.index.AsyncIssueIndexingImpl.triggerOnIndexCreation(AsyncIssueIndexingImpl.java:81)

      This can happen when starting SonarQube with no ES folder, which triggers the asynchronous index recreation. During this step, if one/several projects have no snapshot, the comparator used to sort the project by popularity can throw this error. The error comes from the comparator itself, which does not respect the transitivity contract of the Comparator interface.

       

      Edit: the issue is likely to occur with a few hundred of projects, with a mix of analyzed and never analyzed projects.

        Attachments

          Activity

            People

            Assignee:
            pierre.guillot Pierre Guillot
            Reporter:
            pierre.guillot Pierre Guillot
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: