Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-53820

If no Server Authentication Token is defined, it will cause builds to fail

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: sonar-plugin
    • Labels:
      None
    • Environment:
      Sonar version 2.8.1
    • Similar Issues:

      Description

      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

        Attachments

          Activity

            People

            Assignee:
            sonarteam Sonar Team
            Reporter:
            ataylor Alex Taylor
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: