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

scm poll triggers even there is no change in repository(bitbucket)

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-plugin
    • None
    • we are using Jenkins LTS 2.176.3 on hosted on amazonlinux , job-dsl - 1.74 , git plugin - 4.0.0-rc

      step 1: create a seed job 
      ```
      String basepath = 'Common/Java/testapp'

      String giturl = 'git@bitbucket.org:abc/testapp'

      pipelineJob("$basepath/1.Build-Dev-Int") {
      logRotator {
      numToKeep(10)
      artifactNumToKeep(10)
      }
      parameters {
      stringParam('USE_GIT_BRANCH', 'master')
      }
      throttleConcurrentBuilds {
      maxTotal(1)
      }

      triggers {
      scm('H/15 * * * *')
      }

      definition {
      cpsScm {
      scm {
      git

      { remote \{ url(giturl) }

      branches('master')
      extensions { }
      }
      scriptPath('pipeline/pipeline_dev_int.groovy')
      }
      }
      }
      }```
      step 2 : create pipeline_dev_int.groovy

      ```@Library('sharedlibrary@master')

      node()

      remaining groovy script```
       

      step 3:     configured shared library in manage jenkins
      even though there is no change in repo it is triggering jobs 
       

       

      whenever a branch/ commit made to the shared library even though there is no change in testapp repo it triggering the job for every 15 min and found this in polling history

      Using strategy: Default
      [poll] Last Built Revision: Revision 6717866352d0d5a5e9b41da88a799993ab1d4191 (origin/master)
      No credentials specified
      > git --version # timeout=10
      > git ls-remote -h git@bitbucket.org:abc/testapp # timeout=10
      Found 3 remote heads on git@bitbucket.org:abc/testapp
      [poll] Latest remote head revision on refs/heads/master is: 6717866352d0d5a5e9b41da88a799993ab1d4191 - already built by 97
      Using strategy: Specific revision
      [poll] Last Built Revision: Revision a7cf4fd0c7484765c4a5166a36613c387aee8501 (surya/MCDCA-1412-ECR-NEW-ACCOUNT)
      No credentials specified
      > git --version # timeout=10
      > git ls-remote -h git@bitbucket.org:abc/sharedlibrary # timeout=10
      Found 3 remote heads on git@bitbucket.org:abc/sharedlibrary
      [poll] Latest remote head revision on refs/heads/surya/MCDCA-1412-ECR-NEW-ACCOUNT is: ab8eb071afb815bca04fd4e50a991ae54ea37e8c
      Using strategy: Default
      [poll] Last Built Revision: Revision 6717866352d0d5a5e9b41da88a799993ab1d4191 (origin/master)
      using credential 6e83116e-4fb6-491a-a2c9-9ac9d51d4765
      > git --version # timeout=10
      using GIT_SSH to set credentials
      > git ls-remote -h git@bitbucket.org:abc/testapp # timeout=10
      Found 3 remote heads on git@bitbucket.org:abc/testapp
      [poll] Latest remote head revision on refs/heads/master is: 6717866352d0d5a5e9b41da88a799993ab1d4191 - already built by 97
      Done. Took 8.6 sec
      Changes found

      Polling Log

      This page captures the polling log that triggered this build.
      Started on Jul 30, 2018 7:15:00 PM Using strategy: Default [poll] Last Built Revision: Revision 80ae1a7997f138af5faa0e594eca7e88eb174026 (origin/master) > git --version # timeout=10 > git ls-remote -h git@bitbucket.org:xxx/xxxxxxx # timeout=10 Found 1 remote heads on git@bitbucket.org:xx/xxxxxx[poll] Latest remote head revision on refs/heads/master is: 80ae1a7997f138af5faa0e594eca7e88eb174026 - already built by 185 no polling baseline in /var/lib/jenkins/workspace/Sandbox/xxxx/xxxx/1.Build-Dev-Int@libs/xxx on Using strategy: Default > git --version # timeout=10 using GIT_SSH to set credentials Bitbucket SSH Key > git ls-remote -h git@bitbucket.org:xxxxx.git # timeout=10 Found 1 remote heads on git@bitbucket.org:xx/xxxx.git [poll] Latest remote head revision on refs/heads/master is: 80ae1a7997f138af5faa0e594eca7e88eb174026 Done. Took 2.7 sec Changes found

          [JENKINS-52816] scm poll triggers even there is no change in repository(bitbucket)

          suryatej yaramada created issue -
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          suryatej yaramada made changes -
          Description Original: we are using dsl jobs to  create jobs for scripted pipelines and had this function 
          triggers {
          scm('H/10 * * * *')
           
          even though there is no change in repo it is triggering jobs , we are using ecs executors
           
          h1. Polling Log

          This page captures the polling log that triggered this build.
          Started on Jul 30, 2018 7:15:00 PM Using strategy: Default [poll] Last Built Revision: Revision 80ae1a7997f138af5faa0e594eca7e88eb174026 (origin/master) > git --version # timeout=10 > git ls-remote -h git@bitbucket.org:xxx/xxxxxxx # timeout=10 Found 1 remote heads on git@bitbucket.org:xx/xxxxxx[poll] Latest remote head revision on refs/heads/master is: 80ae1a7997f138af5faa0e594eca7e88eb174026 - already built by 185 no polling baseline in /var/lib/jenkins/workspace/Sandbox/xxxx/xxxx/1.Build-Dev-Int@libs/jpl on Using strategy: Default > git --version # timeout=10 using GIT_SSH to set credentials Bitbucket SSH Key > git ls-remote -h git@bitbucket.org:xxxxx.git # timeout=10 Found 1 remote heads on git@bitbucket.org:xx/xxxx.git [poll] Latest remote head revision on refs/heads/master is: 80ae1a7997f138af5faa0e594eca7e88eb174026 Done. Took 2.7 sec Changes found
          New: we are using dsl jobs to  create jobs for scripted pipelines and had this function 
           triggers {
           scm('H/10 * * * *')
            
           even though there is no change in repo it is triggering jobs , we are using ecs executors
            
          h1. Polling Log

          This page captures the polling log that triggered this build.
           Started on Jul 30, 2018 7:15:00 PM Using strategy: Default [poll] Last Built Revision: Revision 80ae1a7997f138af5faa0e594eca7e88eb174026 (origin/master) > git --version # timeout=10 > git ls-remote -h git@bitbucket.org:xxx/xxxxxxx # timeout=10 Found 1 remote heads on git@bitbucket.org:xx/xxxxxx[poll] Latest remote head revision on refs/heads/master is: 80ae1a7997f138af5faa0e594eca7e88eb174026 - already built by 185 no polling baseline in /var/lib/jenkins/workspace/Sandbox/xxxx/xxxx/1.Build-Dev-Int@libs/xxx on Using strategy: Default > git --version # timeout=10 using GIT_SSH to set credentials Bitbucket SSH Key > git ls-remote -h git@bitbucket.org:xxxxx.git # timeout=10 Found 1 remote heads on git@bitbucket.org:xx/xxxx.git [poll] Latest remote head revision on refs/heads/master is: 80ae1a7997f138af5faa0e594eca7e88eb174026 Done. Took 2.7 sec Changes found
          Cenk Tosun made changes -
          Comment [ one more strange behavior, if the workspaces are missing. No change but two builds with the identical git log
          {code:java}
          Started on Nov 27, 2018 4:39:39 AM
          Using strategy: Default
          [poll] Last Built Revision: Revision fec1077f7d8b5a9b808abd0da6a84966ebe900df (refs/remotes/origin/master)
           > git.exe --version # timeout=10
          using GIT_SSH to set credentials
           > git.exe ls-remote -h <gitUrl> # timeout=10
          Found 21 remote heads on <gitUrl>
          [poll] Latest remote head revision on refs/heads/master is: fec1077f7d8b5a9b808abd0da6a84966ebe900df - already built by 186
          no polling baseline in <buildworkspace>@libs\sharedLibrary on
          Using strategy: Default
          [poll] Last Built Revision: Revision b00d5f0ce8cbf798ff613ac61ec5ad28824afd6b (refs/remotes/origin/master)
          Using strategy: Default
          [poll] Last Built Revision: Revision fec1077f7d8b5a9b808abd0da6a84966ebe900df (refs/remotes/origin/master)
          Using strategy: Default
          [poll] Last Built Revision: Revision 4895bd129cdbd7678807c88f372fdc0b37295cee (refs/remotes/origin/master)
          Done. Took 0.27 sec
          Changes found


          Started on Nov 27, 2018 4:24:39 AM
          Using strategy: Default
          [poll] Last Built Revision: Revision fec1077f7d8b5a9b808abd0da6a84966ebe900df (refs/remotes/origin/master)
           > git.exe --version # timeout=10
          using GIT_SSH to set credentials
           > git.exe ls-remote -h <gitUrl> # timeout=10
          Found 21 remote heads on <gitUrl>
          [poll] Latest remote head revision on refs/heads/master is: fec1077f7d8b5a9b808abd0da6a84966ebe900df - already built by 185
          no polling baseline in <buildworkspace>@libs\sharedLibrary on
          Using strategy: Default
          [poll] Last Built Revision: Revision b00d5f0ce8cbf798ff613ac61ec5ad28824afd6b (refs/remotes/origin/master)
          Using strategy: Default
          [poll] Last Built Revision: Revision fec1077f7d8b5a9b808abd0da6a84966ebe900df (refs/remotes/origin/master)
          Using strategy: Default
          [poll] Last Built Revision: Revision 4895bd129cdbd7678807c88f372fdc0b37295cee (refs/remotes/origin/master)
          Done. Took 0.26 sec
          Changes found
          {code}
           if the workspaces are available, there is no problem and i get outputs like:

          Ignored commit: <sha1> : No paths matched included region whitelist
           Ignored commit: <sha1> : No paths matched included region whitelist

          excluded user: <excludedUser>

           

          {color:#de350b}*And one additinal information:*{color} the jobs run on a farm of various slaves using one common label ]
          Daniel Spilker made changes -
          Assignee New: Daniel Spilker [ daspilker ]
          Resolution New: Cannot Reproduce [ 5 ]
          Status Original: Open [ 1 ] New: Fixed but Unreleased [ 10203 ]
          suryatej yaramada made changes -
          Attachment New: Screenshot from 2019-10-16 16-29-58.png [ 49162 ]
          suryatej yaramada made changes -
          Attachment New: Screenshot from 2019-10-16 16-42-12.png [ 49163 ]
          Mark Waite made changes -
          Resolution Original: Cannot Reproduce [ 5 ]
          Status Original: Fixed but Unreleased [ 10203 ] New: Reopened [ 4 ]
          Mark Waite made changes -
          Status Original: Reopened [ 4 ] New: Open [ 1 ]
          suryatej yaramada made changes -
          Environment Original: we are using Jenkins LTS 2.121.2 on hosted on amazonlinux , recently we downgraded job-dsl plugin to 1.69 as it had few components deprecated which we are using , job-dsl - 1.69 , git plugin - 3.9.1 New: we are using Jenkins LTS 2.176.3 on hosted on amazonlinux , job-dsl - 1.74 , git plugin - 4.0.0-rc
          suryatej yaramada made changes -
          Description Original: we are using dsl jobs to  create jobs for scripted pipelines and had this function 
           triggers {
           scm('H/10 * * * *')
            
           even though there is no change in repo it is triggering jobs , we are using ecs executors
            
          h1. Polling Log

          This page captures the polling log that triggered this build.
           Started on Jul 30, 2018 7:15:00 PM Using strategy: Default [poll] Last Built Revision: Revision 80ae1a7997f138af5faa0e594eca7e88eb174026 (origin/master) > git --version # timeout=10 > git ls-remote -h git@bitbucket.org:xxx/xxxxxxx # timeout=10 Found 1 remote heads on git@bitbucket.org:xx/xxxxxx[poll] Latest remote head revision on refs/heads/master is: 80ae1a7997f138af5faa0e594eca7e88eb174026 - already built by 185 no polling baseline in /var/lib/jenkins/workspace/Sandbox/xxxx/xxxx/1.Build-Dev-Int@libs/xxx on Using strategy: Default > git --version # timeout=10 using GIT_SSH to set credentials Bitbucket SSH Key > git ls-remote -h git@bitbucket.org:xxxxx.git # timeout=10 Found 1 remote heads on git@bitbucket.org:xx/xxxx.git [poll] Latest remote head revision on refs/heads/master is: 80ae1a7997f138af5faa0e594eca7e88eb174026 Done. Took 2.7 sec Changes found
          New: step 1: create a seed job 
          ```
          String basepath = 'Common/Java/testapp'

          String giturl = 'git@bitbucket.org:abc/testapp'

          pipelineJob("$basepath/1.Build-Dev-Int") {
          logRotator {
          numToKeep(10)
          artifactNumToKeep(10)
          }
          parameters {
          stringParam('USE_GIT_BRANCH', 'master')
          }
          throttleConcurrentBuilds {
          maxTotal(1)
          }

          triggers {
          scm('H/15 * * * *')
          }

          definition {
          cpsScm {
          scm {
          git{
          remote \{ url(giturl) }
          branches('master')
          extensions \{ }
          }
          scriptPath('pipeline/pipeline_dev_int.groovy')
          }
          }
          }
          }```
          step 2 : create pipeline_dev_int.groovy

          ```@Library('sharedlibrary@master')

          node()

          remaining groovy script```
            

          step 3:  !Screenshot from 2019-10-16 16-42-12.png|thumbnail!    configured shared library in manage jenkins
           even though there is no change in repo it is triggering jobs 
            

           

          whenever a branch/ commit made to the shared library even though there is no change in testapp repo it triggering the job for every 15 min and found this in polling history

          Using strategy: Default
          [poll] Last Built Revision: Revision 6717866352d0d5a5e9b41da88a799993ab1d4191 (origin/master)
          No credentials specified
          > git --version # timeout=10
          > git ls-remote -h [git@bitbucket.org|mailto:git@bitbucket.org]:abc/testapp # timeout=10
          Found 3 remote heads on [git@bitbucket.org|mailto:git@bitbucket.org]:abc/testapp
          [poll] Latest remote head revision on refs/heads/master is: 6717866352d0d5a5e9b41da88a799993ab1d4191 - already built by 97
          Using strategy: Specific revision
          [poll] Last Built Revision: Revision a7cf4fd0c7484765c4a5166a36613c387aee8501 (surya/MCDCA-1412-ECR-NEW-ACCOUNT)
          No credentials specified
          > git --version # timeout=10
          > git ls-remote -h [git@bitbucket.org|mailto:git@bitbucket.org]:abc/sharedlibrary # timeout=10
          Found 3 remote heads on [git@bitbucket.org|mailto:git@bitbucket.org]:abc/sharedlibrary
          [poll] Latest remote head revision on refs/heads/surya/MCDCA-1412-ECR-NEW-ACCOUNT is: ab8eb071afb815bca04fd4e50a991ae54ea37e8c
          Using strategy: Default
          [poll] Last Built Revision: Revision 6717866352d0d5a5e9b41da88a799993ab1d4191 (origin/master)
          using credential 6e83116e-4fb6-491a-a2c9-9ac9d51d4765
          > git --version # timeout=10
          using GIT_SSH to set credentials
          > git ls-remote -h [git@bitbucket.org|mailto:git@bitbucket.org]:abc/testapp # timeout=10
          Found 3 remote heads on [git@bitbucket.org|mailto:git@bitbucket.org]:abc/testapp
          [poll] Latest remote head revision on refs/heads/master is: 6717866352d0d5a5e9b41da88a799993ab1d4191 - already built by 97
          Done. Took 8.6 sec
          Changes found
          h1. Polling Log

          This page captures the polling log that triggered this build.
           Started on Jul 30, 2018 7:15:00 PM Using strategy: Default [poll] Last Built Revision: Revision 80ae1a7997f138af5faa0e594eca7e88eb174026 (origin/master) > git --version # timeout=10 > git ls-remote -h git@bitbucket.org:xxx/xxxxxxx # timeout=10 Found 1 remote heads on git@bitbucket.org:xx/xxxxxx[poll] Latest remote head revision on refs/heads/master is: 80ae1a7997f138af5faa0e594eca7e88eb174026 - already built by 185 no polling baseline in /var/lib/jenkins/workspace/Sandbox/xxxx/xxxx/1.Build-Dev-Int@libs/xxx on Using strategy: Default > git --version # timeout=10 using GIT_SSH to set credentials Bitbucket SSH Key > git ls-remote -h git@bitbucket.org:xxxxx.git # timeout=10 Found 1 remote heads on git@bitbucket.org:xx/xxxx.git [poll] Latest remote head revision on refs/heads/master is: 80ae1a7997f138af5faa0e594eca7e88eb174026 Done. Took 2.7 sec Changes found

            daspilker Daniel Spilker
            yrsurya suryatej yaramada
            Votes:
            6 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated: