# Error A prior build is still executing on Cron job

**URL:** <https://travis-ci.community/t/error-a-prior-build-is-still-executing-on-cron-job/2548>\
**Category:** Travis CI Discussions & Feedback\
**Created:** [March 5, 2019, 2:12pm UTC](https://travis-ci.community/t/error-a-prior-build-is-still-executing-on-cron-job/2548 "2019-03-05T14:12:03Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![3nids](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/3nids/32/1319_2.png) [@3nids](https://travis-ci.community/u/3nids)\
**Post date:** [March 5, 2019, 2:12pm UTC](https://travis-ci.community/t/error-a-prior-build-is-still-executing-on-cron-job/2548/1 "2019-03-05T14:12:03Z")

</div>

When running a cron job, if there is an unfinished build triggered by the current commit, there is the following error: `A prior build is still executing.` under the requests page.  
Is there anything I could do or is this expected?  
cheers.

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [March 5, 2019, 2:52pm UTC](https://travis-ci.community/t/error-a-prior-build-is-still-executing-on-cron-job/2548/2 "2019-03-05T14:52:57Z")

</div>

Yes, it is expected. Do you have reasons to believe that this was an error?

---

<div class="post-metadata">

**Author:** ![3nids](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/3nids/32/1319_2.png) [@3nids](https://travis-ci.community/u/3nids)\
**Post date:** [March 5, 2019, 3:17pm UTC](https://travis-ci.community/t/error-a-prior-build-is-still-executing-on-cron-job/2548/3 "2019-03-05T15:17:33Z")

</div>

yes, I have jobs behaving differently on Cron than on regular pushes.  
If by mis-chance, the cron is occurring just after a commit, the job won’t be run (my jobs are in the range of 30-90min, so it is quite probable).  
Do you see a way to circumvent this?

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [March 5, 2019, 3:55pm UTC](https://travis-ci.community/t/error-a-prior-build-is-still-executing-on-cron-job/2548/4 "2019-03-05T15:55:29Z")

</div>

Are you saying that when you push to a branch that has a cron job set up while the cron job is still executing, the build request is rejected? Or, are you trying to execute another cron job while one is already running? Which repo is behaving this way, and when did it happen? (The requests page URL is sufficient.)

---

<div class="post-metadata">

**Author:** ![3nids](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/3nids/32/1319_2.png) [@3nids](https://travis-ci.community/u/3nids)\
**Post date:** [March 5, 2019, 4:20pm UTC](https://travis-ci.community/t/error-a-prior-build-is-still-executing-on-cron-job/2548/5 "2019-03-05T16:20:44Z")

</div>

it’s a bit different, I am trying to run a cron job while the push job (of the last commit) is still running  
see [https://travis-ci.org/qgis/QGIS/requests](https://travis-ci.org/qgis/QGIS/requests)  
commit 03fcded on branch release-3\_6, cron ran at 17:18 GMT+1

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [March 5, 2019, 4:39pm UTC](https://travis-ci.community/t/error-a-prior-build-is-still-executing-on-cron-job/2548/6 "2019-03-05T16:39:25Z")

</div>

The latest cron request

 ![32](https://us1.discourse-cdn.com/flex015/uploads/travis_ci/original/2X/7/75dcd1bc02d65b3b128f345190968710204a1564.png) was rejected because this one is still running [https://travis-ci.org/qgis/QGIS/builds/502069218](https://travis-ci.org/qgis/QGIS/builds/502069218). The cron jobs and regular push jobs are evaluated independently whether or not they should be accepted.

The shortest time period you can set up cron jobs is “daily” [https://docs.travis-ci.com/user/cron-jobs/](https://docs.travis-ci.com/user/cron-jobs/) and this should be enough to have them not overlap to avoid this error message.

---

<div class="post-metadata">

**Author:** ![3nids](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/3nids/32/1319_2.png) [@3nids](https://travis-ci.community/u/3nids)\
**Post date:** [March 5, 2019, 4:41pm UTC](https://travis-ci.community/t/error-a-prior-build-is-still-executing-on-cron-job/2548/7 "2019-03-05T16:41:40Z")

</div>

Thanks a lot for digging in.  
I am just cancelling and recreating the crons to test it works as expected.  
So you’re saying the issue is just because I need to let more time between two cron jobs and that it has nothing to do with the fact that a job is currently running with the same commit?

---

<div class="post-metadata">

**Author:** ![3nids](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/3nids/32/1319_2.png) [@3nids](https://travis-ci.community/u/3nids)\
**Post date:** [March 5, 2019, 4:45pm UTC](https://travis-ci.community/t/error-a-prior-build-is-still-executing-on-cron-job/2548/8 "2019-03-05T16:45:17Z")

</div>

PS: Ijust tested again on master, previous cron job was 2h ago, but there is a push job running and I do get the error:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/travis_ci/original/2X/9/9563e8a28caae92dc312973dd67d8af00fadd7cb.png)

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [March 5, 2019, 5:22pm UTC](https://travis-ci.community/t/error-a-prior-build-is-still-executing-on-cron-job/2548/9 "2019-03-05T17:22:20Z")

</div>

> [@BanzaiMan](#):
>
> The cron jobs and regular push jobs are evaluated independently whether or not they should be accepted.

I misspoke here. Currently all jobs on the branch are considered. So, [Travis CI - Test and Deploy with Confidence](https://travis-ci.org/qgis/QGIS/builds/502123137) prevented your cron job from running.

(Optionally, you can configure your cron job to “Always run.”)

---

<div class="post-metadata">

**Author:** ![3nids](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/3nids/32/1319_2.png) [@3nids](https://travis-ci.community/u/3nids)\
**Post date:** [March 5, 2019, 5:46pm UTC](https://travis-ci.community/t/error-a-prior-build-is-still-executing-on-cron-job/2548/10 "2019-03-05T17:46:18Z")

</div>

Ah, ok, so pretty much nothing to do.  
It’s already configured as “always run”.  
Maybe, it would be nice if the job could be queued instead of canceled (but probably not easily done)?  
thanks again for digging in.
