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

Multibranch Plugin errors out on getting branches if a pull request with no commits exists in project

      Multibranch Plugin errors out on getting branches if a pull request with no commits exists in project

       

      Checking PR-redactedXXX from redacted/redacted and branch redacted
      ERROR: [Fri Dec 15 09:57:51 EST 2017] Could not fetch branches from source 6c503aea-13f5-49ba-8bd4-eb99f2290633
      com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketException: Could not determine commit for pull request 7512
      at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.resolveSourceFullHash(BitbucketCloudApiClient.java:367)
      at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource$3.create(BitbucketSCMSource.java:668)
      at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource$3.create(BitbucketSCMSource.java:663)
      at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:339)
      at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrievePullRequests(BitbucketSCMSource.java:661)
      at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:577)
      at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:355)
      at jenkins.scm.api.SCMSource.fetch(SCMSource.java:265)
      at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:634)
      at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:276)
      at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
      at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:978)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:421)
      [Fri Dec 15 09:57:51 EST 2017] Finished branch indexing. Indexing took 2 min 35 sec
      FATAL: Failed to recompute children of redacted
      com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketException: Could not determine commit for pull request 7512
      at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.resolveSourceFullHash(BitbucketCloudApiClient.java:367)
      at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource$3.create(BitbucketSCMSource.java:668)
      at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource$3.create(BitbucketSCMSource.java:663)
      at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:339)
      at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrievePullRequests(BitbucketSCMSource.java:661)
      at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:577)
      at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:355)
      at jenkins.scm.api.SCMSource.fetch(SCMSource.java:265)
      at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:634)
      at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:276)
      at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
      at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:978)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:421)
      Finished: FAILURE```

       

      Found logic causing this here but bitbucket allows PR that have no commits yet.

      https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/b34bd66c7db1ce4f8b2abeb719530d7f7468cbc4/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/client/BitbucketCloudApiClient.java#L367 

          [JENKINS-48586] Multibranch Plugin errors out on getting branches if a pull request with no commits exists in project

          Bradley Wangia created issue -
          Bradley Wangia made changes -
          Description New: Multibranch Plugin errors out on getting branches if a pull request with no commits exists in project

           

          Checking PR-redactedXXX from redacted/redacted and branch redacted
          ERROR: [Fri Dec 15 09:57:51 EST 2017] Could not fetch branches from source 6c503aea-13f5-49ba-8bd4-eb99f2290633
          com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketException: Could not determine commit for pull request 7512
           at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.resolveSourceFullHash(BitbucketCloudApiClient.java:367)
           at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource$3.create(BitbucketSCMSource.java:668)
           at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource$3.create(BitbucketSCMSource.java:663)
           at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:339)
           at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrievePullRequests(BitbucketSCMSource.java:661)
           at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:577)
           at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:355)
           at jenkins.scm.api.SCMSource.fetch(SCMSource.java:265)
           at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:634)
           at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:276)
           at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
           at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:978)
           at hudson.model.ResourceController.execute(ResourceController.java:97)
           at hudson.model.Executor.run(Executor.java:421)
          [Fri Dec 15 09:57:51 EST 2017] Finished branch indexing. Indexing took 2 min 35 sec
          FATAL: Failed to recompute children of redacted
          com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketException: Could not determine commit for pull request 7512
           at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.resolveSourceFullHash(BitbucketCloudApiClient.java:367)
           at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource$3.create(BitbucketSCMSource.java:668)
           at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource$3.create(BitbucketSCMSource.java:663)
           at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:339)
           at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrievePullRequests(BitbucketSCMSource.java:661)
           at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:577)
           at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:355)
           at jenkins.scm.api.SCMSource.fetch(SCMSource.java:265)
           at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:634)
           at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:276)
           at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
           at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:978)
           at hudson.model.ResourceController.execute(ResourceController.java:97)
           at hudson.model.Executor.run(Executor.java:421)
          Finished: FAILURE```
          Bradley Wangia made changes -
          Description Original: Multibranch Plugin errors out on getting branches if a pull request with no commits exists in project

           

          Checking PR-redactedXXX from redacted/redacted and branch redacted
          ERROR: [Fri Dec 15 09:57:51 EST 2017] Could not fetch branches from source 6c503aea-13f5-49ba-8bd4-eb99f2290633
          com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketException: Could not determine commit for pull request 7512
           at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.resolveSourceFullHash(BitbucketCloudApiClient.java:367)
           at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource$3.create(BitbucketSCMSource.java:668)
           at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource$3.create(BitbucketSCMSource.java:663)
           at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:339)
           at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrievePullRequests(BitbucketSCMSource.java:661)
           at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:577)
           at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:355)
           at jenkins.scm.api.SCMSource.fetch(SCMSource.java:265)
           at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:634)
           at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:276)
           at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
           at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:978)
           at hudson.model.ResourceController.execute(ResourceController.java:97)
           at hudson.model.Executor.run(Executor.java:421)
          [Fri Dec 15 09:57:51 EST 2017] Finished branch indexing. Indexing took 2 min 35 sec
          FATAL: Failed to recompute children of redacted
          com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketException: Could not determine commit for pull request 7512
           at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.resolveSourceFullHash(BitbucketCloudApiClient.java:367)
           at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource$3.create(BitbucketSCMSource.java:668)
           at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource$3.create(BitbucketSCMSource.java:663)
           at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:339)
           at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrievePullRequests(BitbucketSCMSource.java:661)
           at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:577)
           at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:355)
           at jenkins.scm.api.SCMSource.fetch(SCMSource.java:265)
           at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:634)
           at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:276)
           at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
           at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:978)
           at hudson.model.ResourceController.execute(ResourceController.java:97)
           at hudson.model.Executor.run(Executor.java:421)
          Finished: FAILURE```
          New: Multibranch Plugin errors out on getting branches if a pull request with no commits exists in project

           

          Checking PR-redactedXXX from redacted/redacted and branch redacted
           ERROR: [Fri Dec 15 09:57:51 EST 2017] Could not fetch branches from source 6c503aea-13f5-49ba-8bd4-eb99f2290633
           com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketException: Could not determine commit for pull request 7512
           at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.resolveSourceFullHash(BitbucketCloudApiClient.java:367)
           at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource$3.create(BitbucketSCMSource.java:668)
           at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource$3.create(BitbucketSCMSource.java:663)
           at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:339)
           at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrievePullRequests(BitbucketSCMSource.java:661)
           at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:577)
           at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:355)
           at jenkins.scm.api.SCMSource.fetch(SCMSource.java:265)
           at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:634)
           at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:276)
           at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
           at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:978)
           at hudson.model.ResourceController.execute(ResourceController.java:97)
           at hudson.model.Executor.run(Executor.java:421)
           [Fri Dec 15 09:57:51 EST 2017] Finished branch indexing. Indexing took 2 min 35 sec
           FATAL: Failed to recompute children of redacted
           com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketException: Could not determine commit for pull request 7512
           at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.resolveSourceFullHash(BitbucketCloudApiClient.java:367)
           at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource$3.create(BitbucketSCMSource.java:668)
           at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource$3.create(BitbucketSCMSource.java:663)
           at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:339)
           at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrievePullRequests(BitbucketSCMSource.java:661)
           at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:577)
           at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:355)
           at jenkins.scm.api.SCMSource.fetch(SCMSource.java:265)
           at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:634)
           at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:276)
           at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
           at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:978)
           at hudson.model.ResourceController.execute(ResourceController.java:97)
           at hudson.model.Executor.run(Executor.java:421)
           Finished: FAILURE```

           

          Found logic causing this here but bitbucket allows PR that have no commits yet.

          [https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/b34bd66c7db1ce4f8b2abeb719530d7f7468cbc4/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/client/BitbucketCloudApiClient.java#L367
          Matthew DeTullio made changes -
          Component/s New: bitbucket-branch-source-plugin [ 21428 ]
          Component/s New: branch-api-plugin [ 18621 ]
          Component/s Original: multi-branch-project-plugin (not Pipeline) [ 21127 ]
          Matthew DeTullio made changes -
          Assignee Original: Matthew DeTullio [ mjdetullio ] New: Stephen Connolly [ stephenconnolly ]
          Stephen Connolly made changes -
          Assignee Original: Stephen Connolly [ stephenconnolly ] New: rsandell [ rsandell ]
          Andrew Bayer made changes -
          Labels Original: plugin New: plugin triaged-2018-11
          Nikolas Falco made changes -
          Assignee Original: rsandell [ rsandell ] New: Nikolas Falco [ nfalco ]

          Nikolas Falco added a comment -

          Is this issue still present in latest plugin version?

          Nikolas Falco added a comment - Is this issue still present in latest plugin version?

            nfalco Nikolas Falco
            bwangia Bradley Wangia
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: