Why are we randomly getting an error that builds are not present in the queue?
Asked by Mike Boucher:

Hello,

Every now and then we get an error in Bamboo that states:

*Build DVP-R105JB-UT-14 had to be cancelled: it was marked as queued but was not present in the queue for (at least) the past 720 seconds.*

The build will cancel and then the next time it runs it will complete. We have no pattern in when this happens and other builds complete successfully when these events occure so we can not determine exactly what this error is telling us. More information on what exactly this error is reporting and how a build is marked but not present in a queue would be very much apprechiated.

Thank you


Answers:
author: Przemek Bruski
body: If you're getting that problem and you're not using 4.4.x, please upgrade. 4.4 fixes some of the causes for this problem. As Jan mentioned, the other thing to check, especially if you're running a lot of local agents is to increase the number of db connections. If neither of that helps, please contact support.


author: Sean Dockery
body: We have been experiencing a similar problem and realized that it was being caused by intermittent DNS lookup failures from the remote agent machines, presumably when the remote agent was trying to call home and say "yes, I'll take that job." Since having added IP entries for the Bamboo server machine to the remote agent machines' hosts file, we haven't suffered a single incident.


author: ArmenA
body: Hi Mike,

One of our customers was confronting this same issue and he suggested the resolution. I verified with our developers that this parameter is hardcoded into Bamboo 5.0, so you might want to upgrade to the latest Bamboo version. I couldn't find any ticket or documentation on this.

Armen


author: ArmenA
body: Can you give this [KB article](https://confluence.atlassian.com/display/BAMKB/Bamboo+Builds+are+randomly+failing+-+it+was+marked+as+queued+but+was+not+present+in+the+queue) a try and let us know if that helps?

comments: author: Mike Boucher
body: Can you please provide me with some more information on what this setting actually does? Is there a ticket or more documentation tracking information about this?


author: Jan Swaelens
body: It's [BSP-9501](https://support.atlassian.com/browse/BSP-9501) but I don't think you will have access.


author: Przemek Bruski
body: <https://confluence.atlassian.com/display/BAMBOO/Hardware+sizing+considerations>


author: Mike Boucher
body: We are running version 4.4.2 build 3503. We have 18 agents and hibernate.c3p0.max_size is 25.

Is there a recomended ratio for agents vs the number of database connections? Do plugins or other factors play a role in the number of database connections to use? Is it in the documentation?

Jan, can you please post the support case?

Thank you


author: Jan Swaelens
body: I'm on the 4.4.4 since yesterday - so far no errors but I also upped the connections to 200 so I'm not sure which of the two did it. The 4.4.3 still yielded the error with 100 connections.

Not sure that our number of agents qualifies as a lot though, it's only 7.

comments: author: Przemek Bruski
body: There should be no difference between .3 and .4 in that regard. 7 local agents is not a lot. You should contact support.


author: Jan Swaelens
body: We are getting the same errors, on what version do you have this? I already logged a support case too, which is pending further tests to make sure that the proposed solution fixes the problem (putting a higher number of database connections in the bamboo configuration xml file).