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

Could not fetch branches from source [some-guid] java.lang.NullPointerException

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • None
    • Jenkins ver. 2.32.3 on Ubuntu 16.04 LTS on Azure VM.

      In a multibranch project, when scanning a private GitHub repo I get:

       

       

      Checking branch feature/CLP-68
            'Jenkinsfile' found
          Met criteria
      ERROR: [Wed Mar 08 16:38:29 UTC 2017] Could not fetch branches from source 941d83d6-48dc-4c5b-88f6-9f0774744aaf
      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 org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.doRetrieve(GitHubSCMSource.java:741)
      at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:451)
      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 16:38:29 UTC 2017] Finished branch indexing. Indexing took 2.9 sec
      FATAL: Failed to recompute children of clientpanel
      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 org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.doRetrieve(GitHubSCMSource.java:741)
      at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:451)
      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-42588] Could not fetch branches from source [some-guid] java.lang.NullPointerException

          Bartłomiej Szypelow created issue -
          Craig Muchinsky made changes -
          Priority Original: Major [ 3 ] New: Critical [ 2 ]

          Has anybody identified a workaround for this issue? Downgrading the plugin didn't seem to work.

          Craig Muchinsky added a comment - Has anybody identified a workaround for this issue? Downgrading the plugin didn't seem to work.

          I'm also hitting this. It's preventing any builds of my pipeline job.

          Chance Zibolski added a comment - I'm also hitting this. It's preventing any builds of my pipeline job.

          Craig Muchinsky added a comment - - edited

          I suspect this is related to 

          1. JENKINS-42511

          Any thoughts stephenconnolly?

          Craig Muchinsky added a comment - - edited I suspect this is related to  JENKINS-42511 Any thoughts stephenconnolly ?

          So to work around the issue I had to manually downgrade branch-api to 2.0.7 by uploading http://updates.jenkins-ci.org/download/plugins/branch-api/2.0.7/branch-api.hpi, and then downgrade cloudbees-folder to 5.18.

          Craig Muchinsky added a comment - So to work around the issue I had to manually downgrade branch-api to 2.0.7 by uploading http://updates.jenkins-ci.org/download/plugins/branch-api/2.0.7/branch-api.hpi,  and then downgrade cloudbees-folder to 5.18.

          Provided work around fixed the issue, thank you.

          Onur Gokkocabas added a comment - Provided work around fixed the issue, thank you.
          Craig Muchinsky made changes -
          Link New: This issue is related to JENKINS-42593 [ JENKINS-42593 ]

          Shray Kumar added a comment -

          I tried the above mentioned solutions but they alone did not work. I rebased with the latest github branch source and included this fix: https://github.com/shraykay/github-branch-source-plugin/commit/c74981372b02f5c887f2a2bccba952f4cee09d66 and was able to ensure jenkins was working. 

          Shray Kumar added a comment - I tried the above mentioned solutions but they alone did not work. I rebased with the latest github branch source and included this fix: https://github.com/shraykay/github-branch-source-plugin/commit/c74981372b02f5c887f2a2bccba952f4cee09d66  and was able to ensure jenkins was working. 

          Shray Kumar added a comment -

          Issue is caused by pull requests/branches opened by people who have left private repositories.

          Shray Kumar added a comment - Issue is caused by pull requests/branches opened by people who have left private repositories.

            Unassigned Unassigned
            bszypelow Bartłomiej Szypelow
            Votes:
            10 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated:
              Resolved: