Job without trigger building constantly because of "SCM change"

4,752 views
Skip to first unread message

David Resnick

unread,
May 21, 2015, 1:40:23 AM5/21/15
to jenkins...@googlegroups.com
Unfortunately, I don't have a lot to add to the subject.

The job has SCM but no triggers -- it is triggered using the Parameterized Trigger Plugin.

Yesterday we noticed that it was running continuously (using default parameters), restarting as soon as it finishes the previous build. The builds indicate that they were started by SCM change, but that there were no changes. There have been no new commits in the (git) SCM.

Disabling and then enabling the job stopped it from building, but once it was triggered again (manually) it once again built continuously until disabled.

The logs don't show anything out of the ordinary, just that the job completes successfully:
May 20, 2015 12:27:10 PM hudson.model.Run execute
INFO: Update Machine #5372 main build action completed: SUCCESS

Jenkins is 1.608 with a lot of plugins. There have not been any plugins installed or upgraded recently that might be the trigger to this problem.

Any ideas or suggestions?

Thanks,
David

tfasz

unread,
Jun 26, 2015, 6:10:40 PM6/26/15
to jenkins...@googlegroups.com
Hi David - wondering if you resolved this issue. 

I'm seeing something very similar - a job that gets into a build loop. When I manually hit the Build Now button I immediately see 2 instances of the jobs scheduled with the second one pending completion of the first. Then when the second one starts it triggers a third, etc. The first instance is "Started by <user>" and the subsequent ones are "Started by an SCM change". 

Job details:
- Maven job type
- Git repo
- trigger on SCM poll 
- Git option to "check out to specific local branch" specified

The build #1 appears to run fine but then once a check-in happens to the repo the next triggered (or manually run) build starts looping. 

Jenkins 1.609.1
Git plugin 2.3.5
Maven plugin 2.10

David Resnick

unread,
Jun 28, 2015, 6:28:10 AM6/28/15
to jenkins...@googlegroups.com
Our problem went away, unfortunately we don't know why.

- David

cameronhe...@gmail.com

unread,
Feb 6, 2017, 9:10:44 AM2/6/17
to Jenkins Users
tl;dr: make sure your repo doesn't have more than one branch that matches your Branch Specifier by using the full path to the branch: "refs/heads/master" instead of "origin/master"


Full story:
We were having similar problem with a job in Jenkins 2.19.4.

We would intentionally kick off a particular job, either manually or through a scheduled run, and then the job would keep building over and over. In fact, a second build would be scheduled just after the first one started.

Looking in the console output for the second and subsequent jobs, we saw

Started by an SCM change

as the first line. Odd, we weren't using SCM polling and even if we were, we weren't changing the source repo.


Further down in the console output, we saw:

Multiple candidate revisions
Scheduling another build to catch up with <...name_job...>

We were using origin/master as the branch specifier for the job. Turns out, our source repo had a branch named "master" and another named...sigh... "origin/master". 

Our theory is that, because we weren't specifying a full path for the branch, Jenkins was finding more than one branch and trying to kick of a job for both. Each subsequent job would find two branches, and try and kick off another build, and on and on.

FIX:
We changed the branch specifier in the job to "refs/heads/master". With the full path, Jenkins no longer thought there were multiple branches to build and the followup jobs quit happening.

P.S.:
As an aside, we also deleted the unexpected, unneeded branch "origin/master" from our repo, leaving just "master" behind. 
Reply all
Reply to author
Forward
0 new messages