Jenkins: SCM triggering constant builds despite no change Jenkins: SCM triggering constant builds despite no change jenkins jenkins

Jenkins: SCM triggering constant builds despite no change


I just ran into Jenkins continuously building due to an SCM change, even when there was no change, and polling was not even turned on. This may be different from your scenario but I figured it may still help to share my solution.

Out project is configured to build using the branch specifier */integration just like all of our other integration builds. However, after looking at all of the branches on our origin git repo, I saw that there are two branches that matched the */integration specifier. It looks like a developer must have erroneously pushed to a new branch with a very similar name:

$git branch --remote | grep integration  origin/integration  origin/origin/integration

The solution that fixed this issue for me was to specify the branch fully, using refs/heads/integration. I assume it would also work to simply delete the duplicate offending branch, but by specifying the branch exactly I can avoid running into the same problem in the future.

I'm not sure this is the same cause for your problem but this is what worked for me, and hopefully will work for someone else in this situation.


Seems to be reproducible with latest Jenkins GIT plugin version 2.0.

Downgrade to version 1.x may fix the problem. Though you should also revert Jenkins configuration from older backup as GIT plugin version 1.x seems to be not working with new 2.0 configuration scheme.

This thread suggests to enable "Fast remote polling" as a workaround. In version 2.0 it's called "Force polling using workspace" I think.

Reference to Jenkins issue: https://issues.jenkins-ci.org/browse/JENKINS-20767


I ran into the same problem.

What fixed it for me is noticing that the Git Polling Log looked like this:

Started on [date]Using strategy: Default[poll] Last Built Revision: Revision [commit#] (origin/develop)[...]Found 12 remote heads on ssh://[...]/repo.git[poll] Latest remote head revision on refs/heads/feature/foo is: [commit#] - already built by 1414[poll] Latest remote head revision on refs/heads/feature/bar is: [commit#] - already built by 2365[poll] Latest remote head revision on refs/heads/feature/baz is: [commit#] - already built by 1489[poll] Latest remote head revision on refs/heads/feature/qux is: [commit#] - already built by 1413[poll] Latest remote head revision on refs/heads/develop is: [commit#] - already built by 2368[poll] Latest remote head revision on refs/heads/master is: [commit#]Done. Took 0.16 secChanges found

Notice that the line for master doesn't say 'already built'. I built the master branch and that fixed the problem.