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

          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.

          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.

          Benoît Desvages added a comment - - edited

          Upgrading Folders Plugin (cloudbees-folder) to 6.0.2 solves the problem for me (I'm not using github-branch-source-plugin) with either branch-api 2.0.7 or 2.0.8

          Benoît Desvages added a comment - - edited Upgrading Folders Plugin (cloudbees-folder) to 6.0.2 solves the problem for me (I'm not using github-branch-source-plugin) with either branch-api 2.0.7 or 2.0.8

          same error without github
          i think problem not in github-branch-source-plugin.

          Workaround with downgrade branch-api to 2.0.7 and cloudbees-folder to 5.18 - works

          Dmitry Salashnik added a comment - same error without github i think problem not in github-branch-source-plugin. Workaround with downgrade branch-api to 2.0.7 and cloudbees-folder to 5.18 - works

          Thomas Heigl added a comment -

          Same here. The downgrade workaround worked for me.

          Thomas Heigl added a comment - Same here. The downgrade workaround worked for me.

          FYI I get this with a public repository. Workaround worked.

          Vlad Dumitrescu added a comment - FYI I get this with a public repository. Workaround worked.

          6.0.2 - fixes for me

          Dmitry Salashnik added a comment - 6.0.2 - fixes for me

          Reported fixed by CloudBees Folders 6.0.2

          Stephen Connolly added a comment - Reported fixed by CloudBees Folders 6.0.2

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

              Created:
              Updated:
              Resolved: