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

java.lang.NullPointerException in job when there is no quality gate in Warnings Next Generation Plugin

    XMLWordPrintable

Details

    • warnings-ng 3.0.3

    Description

      A job fail with a java exception. the cause seem to be the Warnings Next Generation.

      It happen when the threshold  are undefined in the section health report configuration.

      the error show is: 

      ERROR: Build step failed with exception
      java.lang.NullPointerException
      at io.jenkins.plugins.analysis.core.util.QualityGate.map(QualityGate.java:179)
      at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.publishResult(IssuesRecorder.java:617)
      at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.record(IssuesRecorder.java:553)
      at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.perform(IssuesRecorder.java:516)
      at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
      at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
      at hudson.model.Build$BuildExecution.post2(Build.java:186)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
      at hudson.model.Run.execute(Run.java:1841)
      at hudson.matrix.MatrixRun.run(MatrixRun.java:153)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:429)

      Attachments

        Activity

          drulli Ulli Hafner added a comment -

          kierzo which version of warnings-ng is installed in your Jenkins?

          drulli Ulli Hafner added a comment - kierzo which version of warnings-ng is installed in your Jenkins?
          drulli Ulli Hafner added a comment -

          BTW: you are mixing health report and quality gates. They are independent of each other.

          drulli Ulli Hafner added a comment - BTW: you are mixing health report and quality gates. They are independent of each other.
          mirza_zeyrek mirza zeyrek added a comment - - edited

          EDIT: Issue of not having options available in static analysis tool section solved by uninstalling all related plug-ins 1 by 1 and installing next generation plug-in only.

          Also found a workaround for Null Pointer Exception. Looks like this tend to happen for newly setup jobs which does not have previous failed jobs. So, you need to make 1st job pass. For this set health gate threshold more than existing warning count. Issue still occurs with latest HPI from Jenkins master - #200

          I have similar issue. drulli Also Static Analysis Tools select box is empty on freestyle job. 

          ERROR: Build step failed with exception
          java.lang.NullPointerException
          at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.scanWithTool(IssuesRecorder.java:492)
          at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.record(IssuesRecorder.java:481)
          at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.perform(IssuesRecorder.java:455)
          at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
          at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
          at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
          at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
          at hudson.model.Build$BuildExecution.post2(Build.java:186)
          at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
          at hudson.model.Run.execute(Run.java:1835)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:97)
          at hudson.model.Executor.run(Executor.java:429)
          Build step 'Record static analysis results' marked build as failure
          Finished: FAILURE

          Here is the installed plug-in versions:

          mirza_zeyrek mirza zeyrek added a comment - - edited EDIT: Issue of not having options available in static analysis tool section solved by uninstalling all related plug-ins 1 by 1 and installing next generation plug-in only. Also found a workaround for Null Pointer Exception. Looks like this tend to happen for newly setup jobs which does not have previous failed jobs. So, you need to make 1st job pass. For this set health gate threshold more than existing warning count. Issue still occurs with latest HPI from Jenkins master - #200 I have similar issue. drulli Also Static Analysis Tools select box is empty on freestyle job.  ERROR: Build step failed with exception java.lang.NullPointerException at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.scanWithTool(IssuesRecorder.java:492) at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.record(IssuesRecorder.java:481) at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.perform(IssuesRecorder.java:455) at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690) at hudson.model.Build$BuildExecution.post2(Build.java:186) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635) at hudson.model.Run.execute(Run.java:1835) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Build step 'Record static analysis results' marked build as failure Finished: FAILURE Here is the installed plug-in versions:
          drulli Ulli Hafner added a comment - - edited

          mirza_zeyrek your NPE is totally different. Please file a new bug report. And please use the released 3.0.3 version (or provide a commit #id) so I can set my workspace to the correct snapshot. The NPE reports that method scanWithTool is on line 492, in the master branch it is at line 576.

          Typically, fixing a NPE is quite easy if I have the correct stack trace.

          drulli Ulli Hafner added a comment - - edited mirza_zeyrek your NPE is totally different. Please file a new bug report. And please use the released 3.0.3 version (or provide a commit #id) so I can set my workspace to the correct snapshot. The NPE reports that method scanWithTool is on line 492, in the master branch it is at line 576. Typically, fixing a NPE is quite easy if I have the correct stack trace.
          kierzo Kieron Kierzo added a comment - - edited

          drulli

          I keep the latest versions (3.0.3) , Jenkins version 2.150.3 (Windows), I also have the old depreciated "Warnings Plug-in" installed too but used in other projects, which is the latest version 5.0.1. It has randomly started working again over the weekend but will report if it starts throwing this error again.

          Thanks for your time.

          kierzo Kieron Kierzo added a comment - - edited drulli I keep the latest versions (3.0.3) , Jenkins version 2.150.3 (Windows), I also have the old depreciated "Warnings Plug-in" installed too but used in other projects, which is the latest version 5.0.1. It has randomly started working again over the weekend but will report if it starts throwing this error again. Thanks for your time.

          People

            drulli Ulli Hafner
            christianruffenach Christian Ruffenach
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: