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).
- Analyse a project with SQ 3.7
- Upgrade to SQ 4.5
- Then immediately upgrade to SQ 5.2
- 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: