This happened after an update of Jenkins to 2.32.3 and the plug-in to 6.0.1. As a result, branch indexing is currently broken and not working at all for us.

      Rolling back Jenkins to 2.19.4 did not help.

      Rolling back the plug-in to 5.18 made (all?) relevant multi-branch pipeline jobs disappear in our Jenkins instance. Thus, we cannot rollback to 5.x.

       

      Started by user ...
      [Wed Mar 08 11:05:05 PST 2017] Starting branch indexing...
      > git rev-parse --is-inside-work-tree # timeout=10
      Setting origin to ...
      > git config remote.origin.url ... # timeout=10
      Fetching & pruning origin...
      Fetching upstream changes from origin
      > git --version # timeout=10
      using GIT_SSH to set credentials ...
      > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* --prune
      Getting remote branches...
      Seen branch in repository origin/...
      Seen branch in repository origin/...
      Seen branch in repository origin/...
      Seen branch in repository origin/...
      Seen branch in repository origin/...
      Seen branch in repository origin/...
      Seen branch in repository origin/...
      Seen branch in repository origin/...
      Seen branch in repository origin/...
      Seen branch in repository origin/...
      Seen 10 remote branches
      Checking branch ...
      ‘Jenkinsfile’ found
      Met criteria
      ERROR: [Wed Mar 08 11:05:08 PST 2017] Could not fetch branches from source ...
      java.lang.NullPointerException
        at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.shouldUpdate(ComputedFolder.java:728)
        at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1890)
        at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:318)
        at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:242)
        at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:212)
        at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:242)
        at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
        at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
        at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:628)
        at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:252)
        at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:154)
        at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:967)
        at hudson.model.ResourceController.execute(ResourceController.java:98)
        at hudson.model.Executor.run(Executor.java:404)
      [Wed Mar 08 11:05:08 PST 2017] Finished branch indexing. Indexing took 2 sec
      FATAL: Failed to recompute children of ...
      java.lang.NullPointerException
        at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.shouldUpdate(ComputedFolder.java:728)
        at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1890)
        at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:318)
        at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:242)
        at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:212)
        at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:242)
        at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
        at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
        at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:628)
        at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:252)
        at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:154)
        at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:967)
        at hudson.model.ResourceController.execute(ResourceController.java:98)
        at hudson.model.Executor.run(Executor.java:404)
      Finished: FAILURE
      

       

          [JENKINS-42593] NPE in Folder Plug-in 6.0.1

          For those trying to roll this back on their Jenkins, grab http://updates.jenkins-ci.org/download/plugins/cloudbees-folder/5.18/cloudbees-folder.hpi and then go to Jenkins > Manage Jenkins > Manage Plugins > Advanced and manually upload the old cloudbees-folder plugin and restart.

          Chris Williams added a comment - For those trying to roll this back on their Jenkins, grab http://updates.jenkins-ci.org/download/plugins/cloudbees-folder/5.18/cloudbees-folder.hpi and then go to Jenkins > Manage Jenkins > Manage Plugins > Advanced and manually upload the old cloudbees-folder plugin and restart.

          Jesse Glick added a comment -

          Best to roll back to 5.18, along with Branch API.

          Jesse Glick added a comment - Best to roll back to 5.18, along with Branch API.

          Jesse Glick added a comment -

          Yeah I thought during code review that Item was using the two-arg (ItemGroup, String) constructor on load (which would mean transient final fields are fine), but no, I was thinking of Run.

          Jesse Glick added a comment - Yeah I thought during code review that Item was using the two-arg (ItemGroup, String) constructor on load (which would mean transient final fields are fine), but no, I was thinking of Run .

          I did try a rollback but that makes some important jobs completely disappear in the Jenkins instance. Thus, a rollback did not work for us.

          Gunnar Wagenknecht added a comment - I did try a rollback but that makes some important jobs completely disappear in the Jenkins instance. Thus, a rollback did not work for us.

          Jesse Glick added a comment -

          guw can you help test a proposed fix?

          Jesse Glick added a comment - guw can you help test a proposed fix?

          Jesse Glick added a comment -

          Anyone interested in “rolling forward”, try this build via Plugin Manager » Advanced » Upload.

          Jesse Glick added a comment - Anyone interested in “rolling forward”, try this build  via Plugin Manager » Advanced » Upload .

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/com/cloudbees/hudson/plugins/folder/computed/ComputedFolder.java
          src/test/java/com/cloudbees/hudson/plugins/folder/computed/ComputedFolder2Test.java
          src/test/java/com/cloudbees/hudson/plugins/folder/computed/ComputedFolderTest.java
          http://jenkins-ci.org/commit/cloudbees-folder-plugin/74a6b0d3642e879152f19081bf370bd31213a8ce
          Log:
          [FIXED JENKINS-42593] Reinitialize transient lock-related fields after restart.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/com/cloudbees/hudson/plugins/folder/computed/ComputedFolder.java src/test/java/com/cloudbees/hudson/plugins/folder/computed/ComputedFolder2Test.java src/test/java/com/cloudbees/hudson/plugins/folder/computed/ComputedFolderTest.java http://jenkins-ci.org/commit/cloudbees-folder-plugin/74a6b0d3642e879152f19081bf370bd31213a8ce Log: [FIXED JENKINS-42593] Reinitialize transient lock-related fields after restart.

          Jesse Glick added a comment -

          Released as 6.0.2, should be on the update center soon.

          Jesse Glick added a comment - Released as 6.0.2, should be on the update center soon.

          Jesse Glick added a comment -

          I did try a rollback but that makes some important jobs completely disappear

          Possibly you forgot to roll back Branch API to 2.0.7, so Jenkins disabled it and Pipeline: Multibranch due to unsatisfied dependencies. Would be obvious from your system log if so. (Currently there is not an admin monitor for forcibly disabled plugins; already filed somewhere.)

          Jesse Glick added a comment - I did try a rollback but that makes some important jobs completely disappear Possibly you forgot to roll back Branch API to 2.0.7, so Jenkins disabled it and Pipeline: Multibranch due to unsatisfied dependencies. Would be obvious from your system log if so. (Currently there is not an admin monitor for forcibly disabled plugins; already filed somewhere.)

          Jesse Glick added a comment -

          (There is also an RFE filed for an admin monitor which appears if some items, in this case MultiBranchProject, failed to load due to the defining plugin being disabled.)

          Jesse Glick added a comment - (There is also an RFE filed for an admin monitor which appears if some items, in this case MultiBranchProject , failed to load due to the defining plugin being disabled.)

            jglick Jesse Glick
            guw Gunnar Wagenknecht
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: