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

Webhook pushes from other branches cause master branch pipeline to run

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: bitbucket-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.235.5
      Bitbucket Plugin 1.1.27
    • Similar Issues:

      Description

      Hi, we have this plugin configured to be executed when we push changes to master branch only.

       

      Sometimes  (once, twice per week) this pipeline is executed automatically when we push changes into other branches (on same repository). We cannot find any behaviour to reproduce it... It's happens only few times.

      This behaviour started few weeks ago automatically. We updated Jenkins and plugins to the last version and it's still happens.

       

      We enabled webhooks logs at Bitbucket and we didn't see troubles there... The payload seams correct (contains branch name, and commit hash are correct to the related branch)

       Also we enable more verbose logs in Jenkins, this is what we see:

      Nov 17, 2020 7:38:23 AM INFO com.cloudbees.jenkins.plugins.BitbucketPayloadProcessor processPayload
      Processing new Webhooks payload
      
      Nov 17, 2020 7:38:23 AM INFO com.cloudbees.jenkins.plugins.BitbucketPayloadProcessor processWebhookPayload
      Received commit hook notification for {"scm":"git","website":"","uuid":"{be286268-cf76-4046-a33e-9bdc8e4745ff}","links":{"self":
      {"href":"https://api.bitbucket.org/2.0/repositories/..............
      
      Nov 17, 2020 7:38:23 AM INFO com.cloudbees.jenkins.plugins.BitbucketJobProbe triggerMatchingJobs 
      Triggering BitBucket job backend-deploy
      

       Note: "backend-deploy" is our master branch pipeline 

       

      This is our pipeline configuration

       

      Note: When we do a "merge to master" manually from our branches this jobs is executed correctly. As I said before, "sometimes" runs automatically when push changes into other branches (non-master).

       

      These are screenshots from Bitbucket webhooks history

       

        Attachments

          Activity

          Hide
          satheeshpayoda SatheeshP added a comment -

          Carlos Coronado

          Are you trying to clone any other repo in your Jenkinsfile?

          Show
          satheeshpayoda SatheeshP added a comment - Carlos Coronado Are you trying to clone any other repo in your Jenkinsfile?
          Hide
          carlos_mt Carlos Coronado added a comment -

          Hi SatheeshP , What do you mean?

          We have multiple pipelines with other repositories. And we have other pipeline with multibranch plugin enabled on same repository as in this ticket description.

          All environment was working fine last past years, but it starting to make an "automatic run" when nobody push changes to master (the pushes goes for multibranch: only PRs). It's randomly... only happens never/once/twice per week...

          Show
          carlos_mt Carlos Coronado added a comment - Hi SatheeshP  , What do you mean? We have multiple pipelines with other repositories. And we have other pipeline with multibranch plugin enabled on same repository as in this ticket description. All environment was working fine last past years, but it starting to make an "automatic run" when nobody push changes to master (the pushes goes for multibranch: only PRs). It's randomly... only happens never/once/twice per week...
          Hide
          carlos_mt Carlos Coronado added a comment -

          Sorry, I now understand you xD

          No, in the Jenkins file there isn't a "checkout" step. The git configuration is in the jenkins pipeline, and it is forced always to "master".

          Thanks.

          Show
          carlos_mt Carlos Coronado added a comment - Sorry, I now understand you xD No, in the Jenkins file there isn't a "checkout" step. The git configuration is in the jenkins pipeline, and it is forced always to "master". Thanks.
          Hide
          satheeshpayoda SatheeshP added a comment -

          Okay Carlos Coronado . Check the Webhook log in the Jenkins it may help you to debug the issue.

          I'm facing different kind of issue JENKINS-64340

           

          Show
          satheeshpayoda SatheeshP added a comment - Okay Carlos Coronado . Check the Webhook log in the Jenkins it may help you to debug the issue. I'm facing different kind of issue JENKINS-64340  
          Hide
          carlos_mt Carlos Coronado added a comment -

          SatheeshP that issue is very similar, and may be possible in our environment (all our repositories in Bitbucket doesn't have webhooks enabled).

          But we are pushing many changes in all repositories every day and the bug happens randomly, as I said before, happens only once/twice/none per week. I'll try to reproduce steps in the other issue and confirm that happens us the same.

           

          In other hand, I'll follow the other issue and when ready, I'll also test it and I update this issue.

          Thanks for all.

          Show
          carlos_mt Carlos Coronado added a comment - SatheeshP  that issue is very similar, and may be possible in our environment (all our repositories in Bitbucket doesn't have webhooks enabled). But we are pushing many changes in all repositories every day and the bug happens randomly, as I said before, happens only once/twice/none per week. I'll try to reproduce steps in the other issue and confirm that happens us the same.   In other hand, I'll follow the other issue and when ready, I'll also test it and I update this issue. Thanks for all.
          Hide
          carlos_mt Carlos Coronado added a comment -

          Any update about this? We still having this issue randomly....

          Show
          carlos_mt Carlos Coronado added a comment - Any update about this? We still having this issue randomly....

            People

            Assignee:
            tzach_solomon Tzach Solomon
            Reporter:
            carlos_mt Carlos Coronado
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: