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

recordIssues and ScanForIssues in Pipeline get NPE Errors

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: warnings-ng-plugin
    • Labels:
      None
    • Environment:
      Jenkins Version - 2.150.1 LTS
    • Similar Issues:
    • Released As:
      warnings-ng 1.0.1

      Description

      Hello!

      When i use Android Lint or PMD in Declarative Pipeline, i get NPE.
      Freestyle Job working fine with Android Lint and PMD.

      This is my part of Pipeline: 

      recordIssues(
          enabledForFailure: true, 
          tools: [
              androidLint(pattern: '**/lint-results*.xml'), 
              checkStyle(pattern: '**/checkstyle*.xml'), 
              findBugs(pattern: '**/findbugs*.xml', useRankAsPriority: true) 
              pmd(pattern: '**/pmd*.xml')
          ]
      )
      

      This is received error:

      java.lang.NullPointerException
          at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.record(IssuesRecorder.java:621)
          at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.perform(IssuesRecorder.java:597)
          at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
          at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
          at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:51)
          at hudson.security.ACL.impersonate(ACL.java:290)
          at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:48)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748)
      

      Actually, when i used scanForIssues, I've got another problem:

      java.lang.NullPointerException
          at io.jenkins.plugins.analysis.core.steps.ScanForIssuesStep$Execution.run(ScanForIssuesStep.java:160)
          at io.jenkins.plugins.analysis.core.steps.ScanForIssuesStep$Execution.run(ScanForIssuesStep.java:126)
          at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:51)
          at hudson.security.ACL.impersonate(ACL.java:290)
          at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:48)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748)
      

      Thank You!

        Attachments

          Issue Links

            Activity

            Hide
            drulli Ulli Hafner added a comment - - edited

            You still can use the old android plugin, then you need to use the class syntax:

            recordIssues tool: [$class: 'AndroidLint']
            

            I added an additional symbol for the next release: androidLintParser.

            Show
            drulli Ulli Hafner added a comment - - edited You still can use the old android plugin, then you need to use the class syntax: recordIssues tool: [$class: 'AndroidLint' ] I added an additional symbol for the next release: androidLintParser .
            Hide
            jglick Jesse Glick added a comment -

            there is no way to prevent the exception

            WDYM? Fix the collision—rename or delete the symbol in one of the plugins. Maybe I am missing some context.

            Show
            jglick Jesse Glick added a comment - there is no way to prevent the exception WDYM? Fix the collision—rename or delete the symbol in one of the plugins. Maybe I am missing some context.
            Hide
            drulli Ulli Hafner added a comment - - edited

            Jesse Glick I think it would be more helpful if the workflow engine would catch the exception and report the duplicate symbol. I don't have the context anymore, I need to guess which symbol is duplicate (I have 100 symbols). From null I don't see which is the duplicate symbol. In the workflow engine you should see what is wrong, or is that information not available? I think handing null to a describable is kind of error that should be detectable at the calling site.

            Show
            drulli Ulli Hafner added a comment - - edited Jesse Glick I think it would be more helpful if the workflow engine would catch the exception and report the duplicate symbol. I don't have the context anymore, I need to guess which symbol is duplicate (I have 100 symbols). From null I don't see which is the duplicate symbol. In the workflow engine you should see what is wrong, or is that information not available? I think handing null to a describable is kind of error that should be detectable at the calling site.
            Hide
            jglick Jesse Glick added a comment -

            it would be more helpful if the workflow engine would catch the exception and report the duplicate symbol

            Right, that is JENKINS-55349.

            I need to guess which symbol is duplicate

            Sorry, my understanding of the issue was that the problematic symbol was known, or discoverable by having steps to reproduce the error. Not so?

            (And in what sense is this issue resolved as Fixed? Was there some code fix?)

            Show
            jglick Jesse Glick added a comment - it would be more helpful if the workflow engine would catch the exception and report the duplicate symbol Right, that is JENKINS-55349 . I need to guess which symbol is duplicate Sorry, my understanding of the issue was that the problematic symbol was known, or discoverable by having steps to reproduce the error. Not so? (And in what sense is this issue resolved as Fixed ? Was there some code fix?)
            Hide
            drulli Ulli Hafner added a comment -

            Right, that is JENKINS-55349.

            Yes, exactly. I opened that additional issue since JENKINS-55328 is about a missing pmdParser and androidLintParser symbol. I added that now so the issue is fixed until someone finds the next duplicate symbol.

            Sorry, my understanding of the issue was that the problematic symbol was known, or discoverable by having steps to reproduce the error. Not so? (And in what sense is this issue resolved as Fixed? Was there some code fix?)

            It was some guessing based on the set of installed plugins.

            Show
            drulli Ulli Hafner added a comment - Right, that is JENKINS-55349 . Yes, exactly. I opened that additional issue since JENKINS-55328 is about a missing pmdParser and androidLintParser symbol. I added that now so the issue is fixed until someone finds the next duplicate symbol. Sorry, my understanding of the issue was that the problematic symbol was known, or discoverable by having steps to reproduce the error. Not so? (And in what sense is this issue resolved as Fixed? Was there some code fix?) It was some guessing based on the set of installed plugins.

              People

              • Assignee:
                drulli Ulli Hafner
                Reporter:
                zava2012 Alexander Yarosenko
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: