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

          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.

          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.

          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.

          Chiming in to report the same issue, jenkins 2.150.2 and blue 1.11.1

          Jacques-Etienne Beaudet added a comment - Chiming in to report the same issue, jenkins 2.150.2 and blue 1.11.1

          Mark Waite added a comment -

          jebeaudet have you installed the 1.2.3 version of Autofavorite for Blue Ocean? That resolved the issue for me.

          Mark Waite added a comment - jebeaudet have you installed the 1.2.3 version of Autofavorite for Blue Ocean? That resolved the issue for me.

          Guy Arad added a comment -

          markewaite it didn't resolved the issue for me. 

          Blue Ocean 1.13.2

          Autofavorite 1.2.3

          Jenkins 2.150.3

          Guy Arad added a comment - markewaite it didn't resolved the issue for me.  Blue Ocean 1.13.2 Autofavorite 1.2.3 Jenkins 2.150.3

          Nick Jones added a comment - - edited

          We installed Blue Ocean this morning (latest released versions of all plugins) and immediately started having the first build of every new branch/PR fail due to this bug. I'm going to uninstall.

          In our case, it was Blue Ocean 1.14.0, Autofavorite 1.2.3, and Jenkins 2.164.1 LTS.

          Nick Jones added a comment - - edited We installed Blue Ocean this morning (latest released versions of all plugins) and immediately started having the first build of every new branch/PR fail due to this bug. I'm going to uninstall. In our case, it was Blue Ocean 1.14.0, Autofavorite 1.2.3, and Jenkins 2.164.1 LTS.

          J P added a comment -

          Any plans to fix? Same issue today. Blue Ocean 1.14.0, Autofavorite 1.2.3. 

          This got a lot of people really upset when we found out about it. Not a nice time. 

          J P added a comment - Any plans to fix? Same issue today. Blue Ocean 1.14.0, Autofavorite 1.2.3.  This got a lot of people really upset when we found out about it. Not a nice time. 

          We have the same issue with: Blue Ocean 1.9.1, Autofavorite 1.2.2 and Jenkins 2.138.41.0.1-fixed

          java.lang.NullPointerException
          at io.jenkins.blueocean.autofavorite.FavoritingScmListener.onCheckout(FavoritingScmListener.java:70)

          Christian Häussler added a comment - We have the same issue with: Blue Ocean 1.9.1, Autofavorite 1.2.2 and Jenkins 2.138.41.0.1-fixed java.lang.NullPointerException at io.jenkins.blueocean.autofavorite.FavoritingScmListener.onCheckout(FavoritingScmListener.java:70)

          Could that help as a Workaround?

          -DBLUEOCEAN_FEATURE_AUTOFAVORITE_ENABLED=false

          Christian Häussler added a comment - Could that help as a Workaround? -DBLUEOCEAN_FEATURE_AUTOFAVORITE_ENABLED=false

          Mark Waite added a comment -

          Thanks for that pointer it12lsp!

          I have enough jobs in my Jenkins server that I find the Blue Ocean autofavorite plugin more of a hindrance than a help. You've now given me a setting that may avoid me getting favorites that aren't actually my favorites. JENKINS-47214 describes that property.

          It is also mentioned in the plugin release notes for release 1.2.1

          Mark Waite added a comment - Thanks for that pointer it12lsp ! I have enough jobs in my Jenkins server that I find the Blue Ocean autofavorite plugin more of a hindrance than a help. You've now given me a setting that may avoid me getting favorites that aren't actually my favorites. JENKINS-47214 describes that property. It is also mentioned in the plugin release notes for release 1.2.1

          Jay Ache added a comment -

          Still not fixed, Blue Ocean 1.21.0, Autofavorite for Blue Ocean 1.2.4, Jenkins 2.150.3

          Anyone working on this? I probably have to completely remove Blue Ocean from our pipeline because of this little Autofavorite bug (I can't use it12lsp's suggestions of -DBLUEOCEAN_FEATURE_AUTOFAVORITE_ENABLED=false because I don't have admin access to my team's Jenkins instance).

          Jay Ache added a comment - Still not fixed, Blue Ocean 1.21.0, Autofavorite for Blue Ocean 1.2.4, Jenkins 2.150.3 Anyone working on this? I probably have to completely remove Blue Ocean from our pipeline because of this little Autofavorite bug (I can't use it12lsp 's suggestions of -DBLUEOCEAN_FEATURE_AUTOFAVORITE_ENABLED=false because I don't have admin access to my team's Jenkins instance).

          Mark Waite added a comment -

          jayache80 I'm not aware of anyone working on it. If you have a Java development environment, you could propose a pull request.

          Mark Waite added a comment - jayache80 I'm not aware of anyone working on it. If you have a Java development environment, you could propose a pull request.

          Nick Jones added a comment -

          In our case the culprit was not restarting the Jenkins instance after the initial install of all the Blue Ocean plugins (including Autofavorite), which is not normally required when installing a new plugin. Every first build of a new branch/PR failed with this problem after that. Our solution was uninstalling every one of the Blue Ocean plugins (which was painful, given how many there are), restarting Jenkins to complete the uninstall, installing Blue Ocean plugins again, and restarting Jenkins again (the step we'd missed before). After that, it has worked perfectly.

          Nick Jones added a comment - In our case the culprit was not restarting the Jenkins instance after the initial install of all the Blue Ocean plugins (including Autofavorite), which is not normally required when installing a new plugin. Every first build of a new branch/PR failed with this problem after that. Our solution was uninstalling every one of the Blue Ocean plugins (which was painful, given how many there are), restarting Jenkins to complete the uninstall, installing Blue Ocean plugins again, and restarting Jenkins again (the step we'd missed before). After that, it has worked perfectly.

          Kamil Mackow added a comment -

          medianick that solved my issue as well, thank you!

          Kamil Mackow added a comment - medianick that solved my issue as well, thank you!

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

              Created:
              Updated: