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

ExcludeOriginPRBranchesSCMHeadFilter NullPointerException

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • gitea-plugin
    • None
    • Gitea Plugin 1.1.2
      Jenkins ver. 2.204.1
      Gitea 1.10.0
    • 1.2.1

      After setting up a Gitea Organization job, the scan crashes on some repos with the following error:

      Looking up repository myorg/my-project
      
        Checking branches...
      
          Checking branch MYPROJECT-1531-Fix-Menu
      ERROR: Failed to create or update a subproject my-project
      java.lang.NullPointerException
      	at org.jenkinsci.plugin.gitea.BranchDiscoveryTrait$ExcludeOriginPRBranchesSCMHeadFilter.isExcluded(BranchDiscoveryTrait.java:239)
      	at jenkins.scm.api.trait.SCMSourceRequest.isExcluded(SCMSourceRequest.java:196)
      	at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:333)
      	at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:286)
      	at org.jenkinsci.plugin.gitea.GiteaSCMSource.retrieve(GiteaSCMSource.java:247)
      	at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373)
      	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:327)
      	at jenkins.branch.MultiBranchProjectFactory$BySCMSourceCriteria.recognizes(MultiBranchProjectFactory.java:263)
      	at jenkins.branch.OrganizationFolder$SCMSourceObserverImpl$1.recognizes(OrganizationFolder.java:1405)
      	at jenkins.branch.OrganizationFolder$SCMSourceObserverImpl$1.complete(OrganizationFolder.java:1420)
      	at jenkins.scm.api.trait.SCMNavigatorRequest.process(SCMNavigatorRequest.java:254)
      	at jenkins.scm.api.trait.SCMNavigatorRequest.process(SCMNavigatorRequest.java:204)
      	at org.jenkinsci.plugin.gitea.GiteaSCMNavigator.visitSources(GiteaSCMNavigator.java:167)
      	at jenkins.branch.OrganizationFolder.computeChildren(OrganizationFolder.java:488)
      	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:277)
      	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:164)
      	at jenkins.branch.OrganizationFolder$OrganizationScan.run(OrganizationFolder.java:969)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:427)
      
      

          [JENKINS-60825] ExcludeOriginPRBranchesSCMHeadFilter NullPointerException

          Paul Eipper added a comment -

          It actually creates a folder for the multibranch project, but the indexing there contains the same error:

          [Mon Jan 20 17:42:29 GMT 2020] Starting branch indexing...
          Looking up repository myog/my-project
          
            Checking branches...
          
              Checking branch MYPROJECT-1531-Fix-Menu
          ERROR: [Mon Jan 20 17:42:30 GMT 2020] Could not fetch branches from source org.jenkinsci.plugin.gitea.GiteaSCMNavigator::https://git.intranet.myorg.com::myorg::my-project
          java.lang.NullPointerException
          	at org.jenkinsci.plugin.gitea.BranchDiscoveryTrait$ExcludeOriginPRBranchesSCMHeadFilter.isExcluded(BranchDiscoveryTrait.java:239)
          	at jenkins.scm.api.trait.SCMSourceRequest.isExcluded(SCMSourceRequest.java:196)
          	at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:333)
          	at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:286)
          	at org.jenkinsci.plugin.gitea.GiteaSCMSource.retrieve(GiteaSCMSource.java:247)
          	at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373)
          	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:283)
          	at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:641)
          	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:277)
          	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:164)
          	at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1032)
          	at hudson.model.ResourceController.execute(ResourceController.java:97)
          	at hudson.model.Executor.run(Executor.java:427)
          [Mon Jan 20 17:42:30 GMT 2020] Finished branch indexing. Indexing took 1.5 sec
          FATAL: Failed to recompute children of My Org » my-project
          java.lang.NullPointerException
          	at org.jenkinsci.plugin.gitea.BranchDiscoveryTrait$ExcludeOriginPRBranchesSCMHeadFilter.isExcluded(BranchDiscoveryTrait.java:239)
          	at jenkins.scm.api.trait.SCMSourceRequest.isExcluded(SCMSourceRequest.java:196)
          	at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:333)
          	at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:286)
          	at org.jenkinsci.plugin.gitea.GiteaSCMSource.retrieve(GiteaSCMSource.java:247)
          	at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373)
          	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:283)
          	at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:641)
          	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:277)
          	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:164)
          	at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1032)
          	at hudson.model.ResourceController.execute(ResourceController.java:97)
          	at hudson.model.Executor.run(Executor.java:427)
          Finished: FAILURE
          
          

          Paul Eipper added a comment - It actually creates a folder for the multibranch project, but the indexing there contains the same error: [Mon Jan 20 17:42:29 GMT 2020] Starting branch indexing... Looking up repository myog/my-project Checking branches... Checking branch MYPROJECT-1531-Fix-Menu ERROR: [Mon Jan 20 17:42:30 GMT 2020] Could not fetch branches from source org.jenkinsci.plugin.gitea.GiteaSCMNavigator::https: //git.intranet.myorg.com::myorg::my-project java.lang.NullPointerException at org.jenkinsci.plugin.gitea.BranchDiscoveryTrait$ExcludeOriginPRBranchesSCMHeadFilter.isExcluded(BranchDiscoveryTrait.java:239) at jenkins.scm.api.trait.SCMSourceRequest.isExcluded(SCMSourceRequest.java:196) at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:333) at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:286) at org.jenkinsci.plugin.gitea.GiteaSCMSource.retrieve(GiteaSCMSource.java:247) at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:283) at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:641) at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:277) at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:164) at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1032) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:427) [Mon Jan 20 17:42:30 GMT 2020] Finished branch indexing. Indexing took 1.5 sec FATAL: Failed to recompute children of My Org » my-project java.lang.NullPointerException at org.jenkinsci.plugin.gitea.BranchDiscoveryTrait$ExcludeOriginPRBranchesSCMHeadFilter.isExcluded(BranchDiscoveryTrait.java:239) at jenkins.scm.api.trait.SCMSourceRequest.isExcluded(SCMSourceRequest.java:196) at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:333) at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:286) at org.jenkinsci.plugin.gitea.GiteaSCMSource.retrieve(GiteaSCMSource.java:247) at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:283) at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:641) at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:277) at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:164) at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1032) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:427) Finished: FAILURE

          m l added a comment -

          One of the reasons for this NullPointerException is a PR with already deleted HEAD

          m l added a comment - One of the reasons for this NullPointerException is a PR with already deleted HEAD

            Unassigned Unassigned
            lkraider Paul Eipper
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: