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

multi-branch pipeline not able to receive bitbucket push event

    XMLWordPrintable

    Details

    • Similar Issues:
    • Released As:
      2.1.1

      Description

      I tested the v2.1 plugin with the normal jenkins pipeline and all works fine, when it comes to multi-branch pipeline job, i can see in Bitbucket server it push the webhook to jenkins successfully on any code push, and in jenkins multi branch project log i can see logs like below:

      // code placeholder
      [Tue Sep 29 15:27:37 BST 2020] Received com.atlassian.bitbucket.jenkins.internal.trigger.BitbucketWebhookConsumer$BitbucketSCMHeadEvent UPDATED event from bitbucket-auto-trigger-test with timestamp Tue Sep 29 15:27:37 BST 2020
      Found match against /folder1/job1
      Found match against /folder1/job2
      Found match against /folder2/job3
      Found match against /folder2/job4
      ......
      Found match against /folder3/jobN
      

       
      but it is very slow, looks like it is searching the whole jenkins instance's multi-branch pipeline jobs to do broadcast on the branch event and it stuck at some jobs, when i remove the problematic job it goes further but stuck at some other jobs again. I am wonder whether this is something handled by the Bitbucket Server Integration plugin or it is with multi-branch pipeline plugin.  If i put my test job into the folder it scans first, e.g. folder1, it works fine.  Can you please advise?
       

        Attachments

          Issue Links

            Activity

            Hide
            adamo Yiorgos Adamopoulos added a comment -

            I confirm the same behavior with

            • Jenkins 2.204.5
            • Bitbucket Server Integration Plugin 2.1.0
            • Branch API plugin 2.5.9
            • Folders plugin 6.14

            Clean, empty installations of Jenkins with the exact same plugins, credentials and Bitbucket configured do not face the issue.

            Is there an upper limit in the number of matches that the Branch API looks for, for example for onSCMHeadEvent() (BitbucketSCMHeadEvent)?

            Show
            adamo Yiorgos Adamopoulos added a comment - I confirm the same behavior with Jenkins 2.204.5 Bitbucket Server Integration Plugin 2.1.0 Branch API plugin 2.5.9 Folders plugin 6.14 Clean, empty installations of Jenkins with the exact same plugins, credentials and Bitbucket configured do not face the issue. Is there an upper limit in the number of matches that the Branch API looks for, for example for onSCMHeadEvent() (BitbucketSCMHeadEvent)?
            Hide
            adamo Yiorgos Adamopoulos added a comment -

            So here is what was at fault in my case:

            Once a webhook for a multibranch pipeline is triggered, the Branch API goes through all jobs defined in Jenkins to find out which ones are multibranch pipeline projects. This is what the "Found match against ..." lines are about. But here is what stops this enumeration process in my case:

            If for some reason the credentials that the pipeline has do not allow it to connect to Bitbucket anymore, then Branch API stops. It does not skip to the next, nor log something in its logfile ($JENKINS_HOME/logs/jenkins.branch.MultiBranchProject.log). It just stops.

            Show
            adamo Yiorgos Adamopoulos added a comment - So here is what was at fault in my case: Once a webhook for a multibranch pipeline is triggered, the Branch API goes through all jobs defined in Jenkins to find out which ones are multibranch pipeline projects. This is what the "Found match against ..." lines are about. But here is what stops this enumeration process in my case: If for some reason the credentials that the pipeline has do not allow it to connect to Bitbucket anymore, then Branch API stops. It does not skip to the next, nor log something in its logfile ($JENKINS_HOME/logs/jenkins.branch.MultiBranchProject.log). It just stops.
            Hide
            brendanh Brendan Holmes added a comment - - edited

            Hi Yiorgos Adamopoulos, we were having the same issue.

            "...credentials that that the pipeline has do not allow it to connect to Bitbucket anymore" - did you manage to fix these pipelines, if so how? In our case the "Found match against <job>" was getting as far as one that was pointing at a non-existent git repo. Disabled this job, and it proceeded to find all MB jobs and trigger successfully.

            Show
            brendanh Brendan Holmes added a comment - - edited Hi Yiorgos Adamopoulos , we were having the same issue. "...credentials that that the pipeline has do not allow it to connect to Bitbucket anymore" - did you manage to fix these pipelines, if so how? In our case the "Found match against <job>" was getting as far as one that was pointing at a non-existent git repo. Disabled this job, and it proceeded to find all MB jobs and trigger successfully.

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              royxszhou2010 roy zhou
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: