title: Jenkins - Build loop
body: <h2>Solutions</h2>
  <p>When configing the branchs to build remove the wildcard *:</p>
  <p><code>*/master</code> to be only <code>master</code></p>
  <hr>
  <h3>This error only occours when a GIT SCM is related to the JOB.</h3>
  <p>Ex: I have a daily job to build an Android project.
  First i thought that it was a cron problem, currently im using <b>50 10 * * *</b>, but i have tried <b>H 10 * * *</b> without any success. When the time comes, it always build the job (Failure or Success) and it queue another job.. and so on...</p>
  <p><i>Would last have run at Friday, May 22, 2015 10:01:58 AM BRT; would next run at Saturday, May 23, 2015 10:01:58 AM BRT.</i></p>
  <p>Even a build with parameter it queue a another job everytime.</p>
  <p>So it stays in a build loop, forever..</p>
  <hr>
  <p><b>Config:</b></p>
  <ul>
  <li>Jenkins ver. 1.614.</li>
  <li>Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-46-generic x86_64)</li>
  <li>GIT client plugin: 1.17.1</li>
  <li>GIT plugin: 2.3.5</li>
  </ul>
  <hr>
  <p><b>Console Output:</b></p>
  <pre><code>Started by an SCM change
  Building in workspace .../jobs/PROJECT_NAME/workspace
   &gt; git rev-parse --is-inside-work-tree # timeout=10
  Fetching changes from the remote Git repository
   &gt; git config remote.origin.url ssh://GIT_ADDRESS/ # timeout=10
  Cleaning workspace
   &gt; git rev-parse --verify HEAD # timeout=10
  Resetting working tree
   &gt; git reset --hard # timeout=10
   &gt; git clean -fdx # timeout=10
  Fetching upstream changes from ssh://GIT_ADDRESS/
   &gt; git --version # timeout=10
   &gt; git -c core.askpass=true fetch --tags --progress ssh://GIT_ADDRESS/ +refs/heads/master:refs/remotes/origin/master
   &gt; git rev-parse refs/remotes/origin/master^{commit} # timeout=10
   &gt; git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
  Multiple candidate revisions
  Scheduling another build to catch up with PROJECT_NAME
  Checking out Revision e6d726c2d31cb0d7e6fad4362ee85e6fac1712c6 (refs/remotes/origin/master)
   &gt; git config core.sparsecheckout # timeout=10
   &gt; git checkout -f e6d726c2d31cb0d7e6fad4362ee85e6fac1712c6
   &gt; git rev-list e6d726c2d31cb0d7e6fad4362ee85e6fac1712c6 # timeout=10
  [Gradle] - Launching build.
  [android] $ gradle clean build assemble
  ...
  </code></pre>
  <p><b>Maybe the problem is this?</b></p>
  <pre><code> &gt; git rev-parse refs/remotes/origin/master^{commit} # timeout=10
   &gt; git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
  Multiple candidate revisions
  Scheduling another build to catch up with PROJECT_NAME
  </code></pre>
  <hr>
  <p><b>The build loop:</b></p>
  <p><img src="https://i.imgur.com/NsSe8v1.png" alt="the build loop" /></p>
  <hr>
  <p><b>Job Config:</b></p>
  <p><img src="https://i.imgur.com/E06ddhX.png" alt="Job config" /></p>
  <hr>
  <p><b>Global Config:</b></p>
  <p><img src="https://i.imgur.com/mLMUF6H.png" alt="Global config" /></p>
  <hr>