-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Sonar version 2.8.1
Issue:
Under `Manage Jenkins > Configure system` if you leave the Server authentication token blank(which you theoretically can do because it says: SonarQube authentication token. Mandatory when anonymous access is disabled) it will cause builds which have sonar configured to fail in a very interesting way. The logs show a Null pointer with this stacktrace:
2018-09-27_08:09:48.63940 SEVERE: #2389 failed to build and we don't even have a listener 2018-09-27_08:09:48.63940 java.lang.NullPointerException 2018-09-27_08:09:48.63940 at hudson.plugins.sonar.SonarBuildWrapper.createLoggerDecorator(SonarBuildWrapper.java:149) 2018-09-27_08:09:48.63941 at jenkins.tasks.SimpleBuildWrapper.decorateLogger(SimpleBuildWrapper.java:192) 2018-09-27_08:09:48.63941 at hudson.model.Run.createBuildListener(Run.java:1827) 2018-09-27_08:09:48.63941 at hudson.model.Run.execute(Run.java:1708) 2018-09-27_08:09:48.63941 at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543) 2018-09-27_08:09:48.63942 at hudson.model.ResourceController.execute(ResourceController.java:97) 2018-09-27_08:09:48.63942 at hudson.model.Executor.run(Executor.java:429)
But does not show a build log which makes it not very obvious about what happened(which is why this is "high")
Resolution:
Following the code I am looking at this line for the cause:
https://github.com/jenkinsci/sonarqube-plugin/blob/master/src/main/java/hudson/plugins/sonar/SonarBuildWrapper.java#L149
This means either there is a need to check for null there and then not grab the data or the configuration item needs to be required under Manage Jenkins