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

Multibranch Pipeline Branch Configuration SCM poll: no changes

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Critical Critical
    • git-plugin
    • None

      properties(pipelineTriggers([pollSCM('H/5 * * * *')])])

      checkout() command using GitSCM

       

      The branch configurations are created correctly (the triggers are registered). SCM poll log updates every 5 minutes, but shows "No changes" despite there being changes on the remote branch. When building, changes are picked up for Jenkins changelog and the "Last Built Revision" is correct - everything works ok, except that polling does not register changes and therefor not trigger.

       

      I know I should use a commit hook, but for now this is not possible.

          [JENKINS-43687] Multibranch Pipeline Branch Configuration SCM poll: no changes

          Mark Waite added a comment - - edited

          I'm unable to duplicate the problem.

          Steps I took trying to duplicate the problem:

          1. Copy JDK 8 tar file into my public_html/jdk directory
              $ mkdir -p ~/public_html/jdk/
              $ cp jdk-8u131-linux-*tar.gz ~/public_html/jdk/
            
          2. Copy the jenkins-bugs repo into a local bare repo for faster cloning later
              $ mkdir -p ~/git/bare/bugs/
              $ cd ~/git/bare/bugs/
              $ git clone --mirror https://github.com/MarkEWaite/jenkins-bugs
            
          3. Clone, build, and run the docker instance
              $ git lfs clone https://github.com/MarkEWaite/docker-lfs JENKINS-43687
              $ cd JENKINS-43687
              $ git lfs fetch origin origin/lts-with-plugins
              $ git checkout -b lts-with-plugins origin/lts-with-plugins
              $ docker build -t jenkins:JENKINS-43687 .
              $ VOL1=~/public_html:/var/jenkins_home/userContent/
              $ VOL2=~/git/bare:/var/lib/git/mwaite/
              $ docker run -i --rm --publish 8080:8080 --volume $VOL1 --volume $VOL2 jenkins:JENKINS-43687
            
          4. Connect a web browser to that docker instance (http://localhost:8080)
          5. Open the "Bugs - Pipeline Checks" folder
          6. Open the "jenkins-bugs" multi-branch pipeline job
          7. Click the "Scan Multibranch Pipeline" link and then the "Run Now" link to start branch indexing
          8. Confirm the JENKINS-43687 job runs successfully
          9. Commit a change to the JENKINS-43687 branch, and push the change
              $ git clone https://github.com/MarkEWaite/jenkins-bugs
              $ cd jenkins-bugs
              $ git checkout -b JENKINS-43687 -t origin/JENKINS-43687
              $ ant increment
              $ git push
            
          10. Wait 5 minutes while watching the git polling log, confirm the git polling log detects the change

          Mark Waite added a comment - - edited I'm unable to duplicate the problem. Steps I took trying to duplicate the problem: Copy JDK 8 tar file into my public_html/jdk directory $ mkdir -p ~/public_html/jdk/ $ cp jdk-8u131-linux-*tar.gz ~/public_html/jdk/ Copy the jenkins-bugs repo into a local bare repo for faster cloning later $ mkdir -p ~/git/bare/bugs/ $ cd ~/git/bare/bugs/ $ git clone --mirror https: //github.com/MarkEWaite/jenkins-bugs Clone, build, and run the docker instance $ git lfs clone https: //github.com/MarkEWaite/docker-lfs JENKINS-43687 $ cd JENKINS-43687 $ git lfs fetch origin origin/lts-with-plugins $ git checkout -b lts-with-plugins origin/lts-with-plugins $ docker build -t jenkins:JENKINS-43687 . $ VOL1=~/public_html:/ var /jenkins_home/userContent/ $ VOL2=~/git/bare:/ var /lib/git/mwaite/ $ docker run -i --rm --publish 8080:8080 --volume $VOL1 --volume $VOL2 jenkins:JENKINS-43687 Connect a web browser to that docker instance ( http://localhost:8080 ) Open the "Bugs - Pipeline Checks" folder Open the "jenkins-bugs" multi-branch pipeline job Click the "Scan Multibranch Pipeline" link and then the "Run Now" link to start branch indexing Confirm the JENKINS-43687 job runs successfully Commit a change to the JENKINS-43687 branch, and push the change $ git clone https: //github.com/MarkEWaite/jenkins-bugs $ cd jenkins-bugs $ git checkout -b JENKINS-43687 -t origin/JENKINS-43687 $ ant increment $ git push Wait 5 minutes while watching the git polling log, confirm the git polling log detects the change

          Mark Waite added a comment - - edited

          Special thanks for the bug report. I wasn't able to duplicate your specific bug, but I found another polling related bug as a result and now I understand it a little better thanks to the necessary investigation.

          I found that with docker-lfs lts-with-plugins branch (sha1:ea3909d) and jenkins-bugs JENKINS-43687 branch (sha1:725da8cc2), the polling detects changes and rebuilds even when there are no changes. Since I set the polling time to 2 minutes in my job, I was building every 2 minutes even though there were no changes to build.

          If I use a more complex checkout command, the false polling stops. I suspect that is the same bug which has been reported by others, but now I've investigated it enough that I have a case which can duplicate it.

          Mark Waite added a comment - - edited Special thanks for the bug report. I wasn't able to duplicate your specific bug, but I found another polling related bug as a result and now I understand it a little better thanks to the necessary investigation. I found that with docker-lfs lts-with-plugins branch (sha1:ea3909d) and jenkins-bugs JENKINS-43687 branch (sha1:725da8cc2) , the polling detects changes and rebuilds even when there are no changes. Since I set the polling time to 2 minutes in my job, I was building every 2 minutes even though there were no changes to build. If I use a more complex checkout command , the false polling stops. I suspect that is the same bug which has been reported by others, but now I've investigated it enough that I have a case which can duplicate it.

          Jens Beyer added a comment -

          Ok, I am sorry, I finally came around to analyzing this issue, and I found the root cause of this in a subtle configuration issue in my Jenkinsfile. Unfortunately, the scm task was not very verbose to tell me enough what's going on.

          From my POV, this issue can be closed, but I am not sure about the handling regarding the related one, so I am leaving this to you, Mark

           

          As a sidenote, a commit hook did not help in this case. It was correctly triggering the polling, but the polling still did not register the changes.

          Jens Beyer added a comment - Ok, I am sorry, I finally came around to analyzing this issue, and I found the root cause of this in a subtle configuration issue in my Jenkinsfile. Unfortunately, the scm task was not very verbose to tell me enough what's going on. From my POV, this issue can be closed, but I am not sure about the handling regarding the related one, so I am leaving this to you, Mark   As a sidenote, a commit hook did not help in this case. It was correctly triggering the polling, but the polling still did not register the changes.

            Unassigned Unassigned
            beyerj Jens Beyer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: