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

git project building twice every time new change committed

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • git-plugin
    • None
    • MacOS, Linux

      Running git-plugin 1.3.0, git-client-plugin 1.0.5, jenkins version 1.506

      Whenever I check in, my build will trigger twice (but only 2 times, never more than that). I've tried limiting to specific branches, and adding different refspecs, but nothing has seemed to work.

      I have attached 3 screenshots. The first is the build information page on the first build. Please note that it says, "2 times"

      The 2nd is the polling log for the first build.

      The 3rd is the polling log for the 2nd build.

      I find that if I watch the polling, the build does not seem to trigger right away and spends some time resetting itself in the quiet period. Once it triggers, it usually triggers with 2 builds to do right away, which can be viewed in the 4th picture.

          [JENKINS-17346] git project building twice every time new change committed

          Xavier Shay added a comment -

          Xavier Shay added a comment - Looks like same issue as https://issues.jenkins-ci.org/browse/JENKINS-23415

          Guido Josquin added a comment -

          Since the last comment was made a while ago - this still seems to happen. A Jenkins job is triggered twice for the same git revision number.

          Guido Josquin added a comment - Since the last comment was made a while ago - this still seems to happen. A Jenkins job is triggered twice for the same git revision number.

          Roman Revyakin added a comment - - edited

          Seems to be still happening on Jenkins ver. 1.609.3 - although not consistently: I've got 2 separate Jenkins instances running the same Jenkins versions and setup identically, running on 2 different machines and tracking 2 different private GitHub repositories: one of the Jenkins will always trigger the build twice for the same changset, exactly as described, another one triggers the builds properly - once per each changes.

          I've just noticed the link to another issue above (https://issues.jenkins-ci.org/browse/JENKINS-23415) and realised that it might be well related to the fact that one of the repositories that is causing this troubles is a large one (>850 Mb), and is wiped out every time prior to the build is triggered, so it's a new git clone every time the build is happening. And according to the linked issue the duplicate build happens whenever the git clone for the first one is still running.

          Roman Revyakin added a comment - - edited Seems to be still happening on Jenkins ver. 1.609.3 - although not consistently: I've got 2 separate Jenkins instances running the same Jenkins versions and setup identically, running on 2 different machines and tracking 2 different private GitHub repositories: one of the Jenkins will always trigger the build twice for the same changset, exactly as described, another one triggers the builds properly - once per each changes. I've just noticed the link to another issue above ( https://issues.jenkins-ci.org/browse/JENKINS-23415 ) and realised that it might be well related to the fact that one of the repositories that is causing this troubles is a large one (>850 Mb), and is wiped out every time prior to the build is triggered, so it's a new git clone every time the build is happening. And according to the linked issue the duplicate build happens whenever the git clone for the first one is still running.

          I'm experiencing the same issue after the last Jenkins upgrade.

          • Git plugin: 2.4.4
          • Jenkins version: 2.7

          In my case, it is just polling to a normal (long lived, not recreated every time) github repo

          the symptoms are the same as described by Stefan Henning

          sebastian slutzky added a comment - I'm experiencing the same issue after the last Jenkins upgrade. Git plugin: 2.4.4 Jenkins version: 2.7 In my case, it is just polling to a normal (long lived, not recreated every time) github repo the symptoms are the same as described by Stefan Henning

          Shoo Yoo Yoon added a comment -

          My Jenkins sever is using mostly the latest version but the same issue. SCM polling is run every 15 minutes but everybuild takes about 2 hours. Two "pollingLog" pages are moslty the same except the started time.

          My Jenkins sever:

          • jenkins : 2.35
          • Git plugin: 3.0.1

          Shoo Yoo Yoon added a comment - My Jenkins sever is using mostly the latest version but the same issue. SCM polling is run every 15 minutes but everybuild takes about 2 hours. Two "pollingLog" pages are moslty the same except the started time. My Jenkins sever: jenkins : 2.35 Git plugin: 3.0.1

          Eyal Zekaria added a comment -

          I experience the same issue described in the original post. I've noticed that this behavior is only happening when the job is configured to build on merge to master. Our PR jobs do not have this issue at all.
          Using:

          • jenkins 2.7.4.4
          • github plugin 1.22.3
          • git plugin 2.6.0

          Eyal Zekaria added a comment - I experience the same issue described in the original post. I've noticed that this behavior is only happening when the job is configured to build on merge to master. Our PR jobs do not have this issue at all. Using: jenkins 2.7.4.4 github plugin 1.22.3 git plugin 2.6.0

          Same here.

           

          Jenkins: 2.147

          github plugin: 1.29.3

          git client plugin: 2.7.3

          git plugin: 3.9.1

          Maksym Sobolyev added a comment - Same here.   Jenkins: 2.147 github plugin: 1.29.3 git client plugin: 2.7.3 git plugin: 3.9.1

          William F added a comment -

          I'm experiencing exactly the same thing as eyalzek – we get double (and sometimes triple) builds fairly frequently for our master branches, but never for PR branches.

           

          Jenkins: 2.150.1

          github plugin: 1.29.4

          git client plugin: 2.7.6

          git plugin: 3.9.3

          William F added a comment - I'm experiencing exactly the same thing as eyalzek – we get double (and sometimes triple) builds fairly frequently for our master branches, but never for PR branches.   Jenkins: 2.150.1 github plugin: 1.29.4 git client plugin: 2.7.6 git plugin: 3.9.3

          Lenny added a comment -

          I am getting duplicate builds on PRs (occasionally) even though quiet period is set to 120 seconds.

          There is an exception in the log, but it may be coincidental:

           

          Sep 21, 2021 5:23:44 PM SEVERE io.jenkins.blueocean.autofavorite.FavoritingScmListener onCheckoutUnexpected error when retrieving changeset
          hudson.plugins.git.GitException: Error: git whatchanged --no-abbrev -M "--format=commit %H%ntree %T%nparent %P%nauthor %aN <%aE> %ai%ncommitter %cN <%cE> %ci%n%n%w(0,4,4)%B" -n 1 1bad1afcb14a41a82963e987511d6536874709c4 in /Users/software/var/jenkins/workspace/owlogix-org-repo_flowlogix_PR-85
          	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$6.execute(CliGitAPIImpl.java:1272)
          	at io.jenkins.blueocean.autofavorite.FavoritingScmListener.getChangeSet(FavoritingScmListener.java:159)
          	at io.jenkins.blueocean.autofavorite.FavoritingScmListener.onCheckout(FavoritingScmListener.java:84)
          	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:155)
          	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:97)
          	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:84)
          	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
          	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
          	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
          	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
          	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
          	at java.base/java.lang.Thread.run(Thread.java:829)
          

          Lenny added a comment - I am getting duplicate builds on PRs (occasionally) even though quiet period is set to 120 seconds. There is an exception in the log, but it may be coincidental:   Sep 21, 2021 5:23:44 PM SEVERE io.jenkins.blueocean.autofavorite.FavoritingScmListener onCheckoutUnexpected error when retrieving changeset hudson.plugins.git.GitException: Error: git whatchanged --no-abbrev -M "--format=commit %H%ntree %T%nparent %P%nauthor %aN <%aE> %ai%ncommitter %cN <%cE> %ci%n%n%w(0,4,4)%B" -n 1 1bad1afcb14a41a82963e987511d6536874709c4 in /Users/software/ var /jenkins/workspace/owlogix-org-repo_flowlogix_PR-85 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$6.execute(CliGitAPIImpl.java:1272) at io.jenkins.blueocean.autofavorite.FavoritingScmListener.getChangeSet(FavoritingScmListener.java:159) at io.jenkins.blueocean.autofavorite.FavoritingScmListener.onCheckout(FavoritingScmListener.java:84) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:155) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:97) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:84) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang. Thread .run( Thread .java:829)

          Lenny added a comment -

          This is still an issue (and getting worse I think!) with the latest Jenkins and plugins as of March 4, 2022

          Lenny added a comment - This is still an issue (and getting worse I think!) with the latest Jenkins and plugins as of March 4, 2022

            Unassigned Unassigned
            el_chapitan Marc Chapman
            Votes:
            24 Vote for this issue
            Watchers:
            26 Start watching this issue

              Created:
              Updated: