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

Duplicate builds triggered from webhook (push) on branch pipelines

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Labels:
      None
    • Environment:
    • Similar Issues:

      Description

      Occasionally, a push to a branch triggers two builds on the corresponding branch in a multibranch pipeline. We are using the GitHub as branch source, and have added a organization wide GitHub webhook on push only. I am not sure about the relationship between the GitHub plugin and the GitHub branch source plugin.

      On normal builds we see the following two lines:

      Started by GitHub push by (author)
      Push event to branch master at 9:31:27 AM on May 2, 2019

      Each of the builds that are triggered twice has just one of the above lines, i.e.

      Started by GitHub push by (author)

      and

       Push event to branch master at 9:31:27 AM on May 2, 2019

      respectively.

       

      Can anyone shed light on what these two lines mean?

       

      The Jenkinsfile has this property:

      properties([
        pipelineTriggers([githubPush()]),
      ])

       

      Removing it does not seem to have any noticable effect though.

        Attachments

          Issue Links

            Activity

            Hide
            bitwiseman Liam Newman added a comment -

            It looks like this is duplicate of JENKINS-54610. Does that look right to you?

            Show
            bitwiseman Liam Newman added a comment - It looks like this is duplicate of JENKINS-54610 . Does that look right to you?
            Hide
            mn_unsilo Mads Navntoft Noe added a comment -

            Liam Newman the issues might be related. In our case, the duplicate builds are triggered by a push directly to master, however. Here is a an except from the scan log:

             

            {{[Tue May 07 10:40:30 CEST 2019] Received Push event to branch master in repository unsiloai/frontend UPDATED event from 1.2.3.4 ⇒ http://xxx/github-webhook/ with timestamp Tue May 07 10:40:23 CEST 2019}}
            {{ 10:40:30 Connecting to https://api.github.com using XXX}}
            {{ Examining xxx/xxxChecking branches...}}
            {{Getting remote branch master...}}
            {{Checking branch master}}
            {}{{Getting remote pull requests from branch master...}}
            'Jenkinsfile’ found
            Met criteria
            {{ Changes detected: master (1d0d76c990ceba060b8e1eda5385e1c0303caf62 → 9c27cad8317b545cae40ea3bda7f637061055000)}}
            {{ Scheduled build for branch: master1 branches were processed (query completed)}}
            {}{{1 branches were processed}}
            {}{{Finished examining xxx/xxx}}
            {{{{}}{{[Tue May 07 10:40:37 CEST 2019] Push event to branch master in repository xxx/xxx }}}}
            {{UPDATED event from 1.2.3.4 ⇒ http://xxx/github-webhook/ with timestamp Tue May 07 10:40:23 CEST 2019 processed in 6.8 sec}}

             

            We will try to remove the PR specific behavior as seen in the screenshot, and report whether the problem persists. If not, it could be related to the PR discovery part.

            Show
            mn_unsilo Mads Navntoft Noe added a comment - Liam Newman the issues might be related. In our case, the duplicate builds are triggered by a push directly to master , however. Here is a an except from the scan log:   {{ [Tue May 07 10:40:30 CEST 2019] Received Push event to branch master in repository unsiloai/frontend UPDATED event from 1.2.3.4 ⇒ http://xxx/github-webhook/ with timestamp Tue May 07 10:40:23 CEST 2019 }} {{ 10:40:30 Connecting to https://api.github.com using XXX }} {{ Examining xxx/xxx Checking branches... }} {{ Getting remote branch master... }} {{ Checking branch master }} { }{{Getting remote pull requests from branch master... }} 'Jenkinsfile’ found Met criteria {{ Changes detected: master (1d0d76c990ceba060b8e1eda5385e1c0303caf62 → 9c27cad8317b545cae40ea3bda7f637061055000) }} {{ Scheduled build for branch: master 1 branches were processed (query completed) }} { }{{1 branches were processed }} { }{{Finished examining xxx/xxx }} {{{{}}{{ [Tue May 07 10:40:37 CEST 2019] Push event to branch master in repository xxx/xxx }}}} {{ UPDATED event from 1.2.3.4 ⇒ http://xxx/github-webhook/ with timestamp Tue May 07 10:40:23 CEST 2019 processed in 6.8 sec }}   We will try to remove the PR specific behavior as seen in the screenshot, and report whether the problem persists. If not, it could be related to the PR discovery part.
            Hide
            mn_unsilo Mads Navntoft Noe added a comment -

            Encountered the issue again today, so it does not seem to be related to the PR specific behavior.

             

            Another detail is that we have multiple projects for the same repository (it's a monorepo), and all of them triggered twice this time. Mostly it's just one of them that triggers twice, though.

            Show
            mn_unsilo Mads Navntoft Noe added a comment - Encountered the issue again today, so it does not seem to be related to the PR specific behavior.   Another detail is that we have multiple projects for the same repository (it's a monorepo), and all of them triggered twice this time. Mostly it's just one of them that triggers twice, though.
            Hide
            mn_unsilo Mads Navntoft Noe added a comment - - edited

            Trying out a workaround using the property strategy "(Deprecated )Suppress automatic SCM triggering" from the Branch API plugin. This results in the builds only being having the line "Started by GitHub push by (author)". So far there have been no new duplicate builds.

            Show
            mn_unsilo Mads Navntoft Noe added a comment - - edited Trying out a workaround using the property strategy "(Deprecated )Suppress automatic SCM triggering" from the Branch API plugin. This results in the builds only being having the line "Started by GitHub push by (author)". So far there have been no new duplicate builds.
            Hide
            mn_unsilo Mads Navntoft Noe added a comment -

            Using the "(Deprecated )Suppress automatic SCM triggering" property strategy, new branches are not being built initially. Does anybody have an idea for a workaround for this?

            Show
            mn_unsilo Mads Navntoft Noe added a comment - Using the "(Deprecated )Suppress automatic SCM triggering" property strategy, new branches are not being built initially. Does anybody have an idea for a workaround for this?
            Hide
            bitwiseman Liam Newman added a comment -

            Mads Navntoft Noe
            That is probably expected behavior for that trait. This is probably something that needs to be fixed in the plugin itself.

            Show
            bitwiseman Liam Newman added a comment - Mads Navntoft Noe That is probably expected behavior for that trait. This is probably something that needs to be fixed in the plugin itself.

              People

              • Assignee:
                lanwen Kirill Merkushev
                Reporter:
                mn_unsilo Mads Navntoft Noe
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: