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

With SonarQube 5.2, it is impossible to analyse a project which latest analysis has been done on SonarQube older than 4.2

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.2
    • Fix Version/s: 5.6
    • Component/s: Compute Engine
    • Labels:

      Description

      Analysing a project with SonarQube 5.2 might be impossible if the last analysis of this project was made on a SonarQube older than 4.2. In such case, a NullPointerException is thrown on com.google.protobuf.Utf8.encodedLength(Utf8.java:378).

      To reproduce:

      1. Analyse a project with SQ 3.7
      2. Upgrade to SQ 4.5
      3. Then immediately upgrade to SQ 5.2
      4. Try to reanalyse the project: it fails.

      Explanation: it's linked to the use of protobuf3 maps: https://developers.google.com/protocol-buffers/docs/proto3#backwards-compatibility.
      It fails when a component path is null (which is the case when a project has not been reanalysed since SQ < 4.2). The maps are build but cannot be converted to a list a key/value entries.

      The programming should be more defensive while building the maps of batch/project WS: https://github.com/SonarSource/sonarqube/blob/master/server/sonar-server/src/main/java/org/sonar/server/batch/ProjectAction.java#L105-105

      See related questions asked on Stackoverflow:

        Attachments

        1. sonar.log
          41 kB
          Teryk Bellahsene

          Issue Links

            Activity

              People

              Assignee:
              sebastien.lesaint Sebastien Lesaint
              Reporter:
              teryk.bellahsene Teryk Bellahsene
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: