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

Pipeline fails with NPE due to Blue Ocean favorites

      This was a new branch, and this was the first time it was built in a multi-branch pipeline.

      [Pipeline] End of Pipeline
       java.lang.NullPointerException
       at io.jenkins.blueocean.autofavorite.FavoritingScmListener.onCheckout(FavoritingScmListener.java:109)
       at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:127)
       at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85)
       at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75)
       at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
       at hudson.security.ACL.impersonate(ACL.java:290)
       at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
       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)
       Finished: FAILURE
      

          [JENKINS-50715] Pipeline fails with NPE due to Blue Ocean favorites

          Renato Rosa created issue -

          Any update on this please?

          First build of new branch in multibranch build fails with below error

          java.lang.NullPointerException
          	at io.jenkins.blueocean.autofavorite.FavoritingScmListener.onCheckout(FavoritingScmListener.java:109)
          	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:127)
          	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85)
          	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75)
          	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
          	at hudson.security.ACL.impersonate(ACL.java:260)
          	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
          	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:1142)
          	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          	at java.lang.Thread.run(Thread.java:745)

           

          Jenkins version: 2.89.4
          Blue Ocean Plugin: 1.5.0

          Autofavorite for Blue Ocean: 1.2.2

          Bhamidi Kishore added a comment - Any update on this please? First build of new branch in multibranch build fails with below error java.lang.NullPointerException at io.jenkins.blueocean.autofavorite.FavoritingScmListener.onCheckout(FavoritingScmListener.java:109) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:127) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47) at hudson.security.ACL.impersonate(ACL.java:260) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44) 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:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang. Thread .run( Thread .java:745)   Jenkins version: 2.89.4 Blue Ocean Plugin: 1.5.0 Autofavorite for Blue Ocean: 1.2.2

          I’m hitting the same issue:
          Multi-branch pipeline from a Bitbucket Server repository. First build of a new branch fails with
           

          Fetching upstream changes from <redacted>  
          > git fetch --no-tags --progress <redacted> Checking out Revision <redacted> (master)   
          > git config core.sparsecheckout # timeout=10   
          > git checkout -f <redacted>
          
          java.lang.NullPointerException
          
          	at io.jenkins.blueocean.autofavorite.FavoritingScmListener.onCheckout(FavoritingScmListener.java:109)
          
          	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:127)
          
          	at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.doRetrieve(SCMSourceRetriever.java:112)
          
          	at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrieve(SCMSourceRetriever.java:84)
          
          	at org.jenkinsci.plugins.workflow.libs.LibraryAdder.retrieve(LibraryAdder.java:153)
          
          	at org.jenkinsci.plugins.workflow.libs.LibraryAdder.add(LibraryAdder.java:134)
          
          	at org.jenkinsci.plugins.workflow.libs.LibraryDecorator$1.call(LibraryDecorator.java:125)
          
          	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1065)
          
          	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
          
          	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
          
          	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
          
          	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
          
          	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
          
          	at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
          
          	at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
          
          	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:131)
          
          	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:125)
          
          	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:560)
          
          	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:521)
          
          	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:325)
          
          	at hudson.model.ResourceController.execute(ResourceController.java:97)
          
          	at hudson.model.Executor.run(Executor.java:429)
          
          
          org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
          
          WorkflowScript: Loading libraries failed
          
          
          1 error
          
          
          	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
          
          	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1085)
          
          	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
          
          	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
          
          	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
          
          	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
          
          	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
          
          	at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
          
          	at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
          
          	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:131)
          
          	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:125)
          
          	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:560)
          
          	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:521)
          
          	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:325)
          
          	at hudson.model.ResourceController.execute(ResourceController.java:97)
          
          	at hudson.model.Executor.run(Executor.java:429)
          
          Finished: FAILURE
          

          Jenkins ver. 2.107.3
          Blue Ocean 1.5.0
          Autofavorite for Blue Ocean 1.2.2
          Git plugin 3.9.1

          Jean-Frédéric added a comment - I’m hitting the same issue: Multi-branch pipeline from a Bitbucket Server repository. First build of a new branch fails with   Fetching upstream changes from <redacted> > git fetch --no-tags --progress <redacted> Checking out Revision <redacted> (master) > git config core.sparsecheckout # timeout=10 > git checkout -f <redacted> java.lang.NullPointerException at io.jenkins.blueocean.autofavorite.FavoritingScmListener.onCheckout(FavoritingScmListener.java:109) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:127) at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.doRetrieve(SCMSourceRetriever.java:112) at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrieve(SCMSourceRetriever.java:84) at org.jenkinsci.plugins.workflow.libs.LibraryAdder.retrieve(LibraryAdder.java:153) at org.jenkinsci.plugins.workflow.libs.LibraryAdder.add(LibraryAdder.java:134) at org.jenkinsci.plugins.workflow.libs.LibraryDecorator$1.call(LibraryDecorator.java:125) at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1065) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688) at groovy.lang.GroovyShell.parse(GroovyShell.java:700) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:131) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:125) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:560) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:521) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:325) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: Loading libraries failed 1 error at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310) at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1085) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688) at groovy.lang.GroovyShell.parse(GroovyShell.java:700) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:131) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:125) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:560) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:521) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:325) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Finished: FAILURE Jenkins ver. 2.107.3 Blue Ocean 1.5.0 Autofavorite for Blue Ocean 1.2.2 Git plugin 3.9.1

          Digging more, it looks like this was fixed via https://github.com/jenkinsci/blueocean-autofavorite-plugin/pull/16, merged on April 5 ; but no release was cut for it. Last release was 1.2.2 on Feb 27.

          Jean-Frédéric added a comment - Digging more, it looks like this was fixed via https://github.com/jenkinsci/blueocean-autofavorite-plugin/pull/16 , merged on April 5 ; but no release was cut for it. Last release was 1.2.2 on Feb 27.
          Jean-Frédéric made changes -
          Component/s New: blueocean-autofavorite-plugin [ 21924 ]

          Also, this might be a duplicate of JENKINS-49774 ?

          Jean-Frédéric added a comment - Also, this might be a duplicate of JENKINS-49774 ?

          Mark Waite added a comment - - edited

          I've seen the same problem with Jenkins 2.138.1, Blue Ocean 1.8.4, and autofavoriting plugin 1.2.2.

          I built the tip of the plugin development branch and confirmed that the tip of the branch does not fail the builds. The build is available in my github repository if someone else needs it before the official release.

          I recommend the tip of the branch be released so that this bug is fixed.

          Mark Waite added a comment - - edited I've seen the same problem with Jenkins 2.138.1, Blue Ocean 1.8.4, and autofavoriting plugin 1.2.2. I built the tip of the plugin development branch and confirmed that the tip of the branch does not fail the builds. The build is available in my github repository if someone else needs it before the official release. I recommend the tip of the branch be released so that this bug is fixed.
          Mark Waite made changes -
          Remote Link New: This issue links to "Build of tip of branch (Web Link)" [ 21906 ]

          Stewart Bryson added a comment - - edited

          I get this with every single PR I open. And it only started in the last month... so I'm not exactly sure if it's related to this thread which was opened months ago. But... the error stack is exactly the same, which you can see below.

          Jenkins: 2.159

          Blue Ocean: 1.10.1

          Autofavoriate: 1.2.2 

          Are people just dealing with this? I'm seriously looking at dumping Jenkins for this. Every single PR fails until I run it manually the first time.

          java.lang.NullPointerException
          	at io.jenkins.blueocean.autofavorite.FavoritingScmListener.onCheckout(FavoritingScmListener.java:70)
          	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:136)
          	at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:144)
          	at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:120)
          	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:293)
          	at hudson.model.ResourceController.execute(ResourceController.java:97)
          	at hudson.model.Executor.run(Executor.java:429)
          Finished: FAILURE
          

           

          Stewart Bryson added a comment - - edited I get this with every single PR I open. And it only started in the last month... so I'm not exactly sure if it's related to this thread which was opened months ago. But... the error stack is exactly the same, which you can see below. Jenkins: 2.159 Blue Ocean: 1.10.1 Autofavoriate: 1.2.2  Are people just dealing with this? I'm seriously looking at dumping Jenkins for this. Every single PR fails until I run it manually the first time. java.lang.NullPointerException at io.jenkins.blueocean.autofavorite.FavoritingScmListener.onCheckout(FavoritingScmListener.java:70) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:136) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:144) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:120) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:293) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Finished: FAILURE  

          Mark Waite added a comment -

          stewartbryson you can either use the build from my github repository or build it yourself. That build resolves the issues I've seen.

          Mark Waite added a comment - stewartbryson you can either use the build from my github repository or build it yourself. That build resolves the issues I've seen.

            Unassigned Unassigned
            renatosilvarosa Renato Rosa
            Votes:
            14 Vote for this issue
            Watchers:
            19 Start watching this issue

              Created:
              Updated: