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

Webhook pushes from other branches cause master branch pipeline to run

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • bitbucket-plugin
    • None
    • Jenkins 2.235.5
      Bitbucket Plugin 1.1.27

    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

          satheeshpayoda SatheeshP added a comment -

          carlos_mt

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

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

          Hi satheeshpayoda , 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...

          carlos_mt Carlos Coronado added a comment - Hi satheeshpayoda  , 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...

          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.

          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.
          satheeshpayoda SatheeshP added a comment -

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

          I'm facing different kind of issue JENKINS-64340

           

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

          satheeshpayoda 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.

          carlos_mt Carlos Coronado added a comment - satheeshpayoda  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.

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

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

          carlos_mt sorry it take me time to respond. I'll try taking a look

          tzach_solomon Tzach Solomon added a comment - carlos_mt  sorry it take me time to respond. I'll try taking a look

          People

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

            Dates

              Created:
              Updated: