Builds cancelled due to marked as queued but not present in the queue for 720 seconds
Platform Notice: Server, Data Center, and Cloud By Request - This article was written for the Atlassian server and data center platforms but may also be useful for Atlassian Cloud customers. If completing instructions in this article would help you, please contact Atlassian Support and mention it.
Problem
Bamboo builds fail semi-randomly and you see messages like this in the server logs:
Build XXX had to be cancelled: it was marked as queued but was not present in the queue for (at least) the past 720 seconds.
Diagnosis
Environment
- In some cases this begins to happen after an upgrade to Bamboo 5.7 and above.
Causes
There are multiple causes of this problem, each with a different solution.
Cause A: Multiple builds triggered at the same time
Post-commit triggers are superior to polling because they reduce load on the build server and source control. However if multiple commits occur rapidly this can cause a race condition. In this case there may be "ghost" builds that result in the "not present in the queue for 720 seconds" messages. - BAM-17890Getting issue details... STATUS
Cause B: Conflict with Group Agent Plugin and Bamboo 5.7.x
There is an incompatibility between Bamboo 5.7.x. and the Group Agent plugin version 1.6. If you are affected by this you will see errors when adding builds to the queue in your logs:
2014-11-21 09:41:59,766 INFO [3-DelayedChangeDetectionThread:pool-7-thread-3] [ChainExecutionManagerImpl] Build BCPRELEASE8-PAR-JOB1-331 has been dispatched
2014-11-21 09:41:59,767 INFO [AtlassianEvent::0-BAM::EVENTS:pool-3-thread-2] [BuildQueueManagerImpl] Attempting to queue BCP Release 8 - Parent - Run build #331 (BCPRELEASE8-PAR-JOB1-331).
2014-11-21 09:41:59,768 INFO [AtlassianEvent::0-BAM::EVENTS:pool-3-thread-2] [ExecutionPhaseServiceImpl] BCP Release 8 - Parent - Run build #331 (BCPRELEASE8-PAR-JOB1-331) queued
2014-11-21 09:41:59,802 ERROR [AtlassianEvent::0-BAM::EVENTS:pool-3-thread-2] [AsynchronousAbleEventDispatcher] There was an exception thrown trying to dispatch event '[com.atlassian.bamboo.v2.build.events.BuildTriggeredEvent[source=com.atlassian.bamboo.build.DefaultBuildExecutionManager@74793ec9], SingleParameterMethodListenerInvoker{method=public void com.atlassian.bamboo.v2.build.queue.BuildTriggeredListener.handleEvent(com.atlassian.bamboo.v2.build.events.BuildTriggeredEvent), listener=com.atlassian.bamboo.v2.build.queue.BuildTriggeredListener@2370e095}]' from the invoker 'java.lang.RuntimeException: com.edwardawebb.bamboo.groupagent.filter.GroupAgentFilter.filter(Lcom/atlassian/bamboo/v2/build/CommonContext;Ljava/util/Collection;Lcom/atlassian/bamboo/v2/build/agent/capability/MinimalRequirementSet;)Ljava/util/Collection;'
Cause C: Default setting for Bamboo versions older than 5.0
In versions of Bamboo prior to version 5.0 the default value of bamboo.send.filenames.to.agent
is set to true which sometimes results in problems adding builds to the queue. This only affects Bamboo versions less than 5.0.
Resolution
Resolution A: Add a 30 second quiet period to the linked repository associated with the build plan.
- Edit the settings for your linked repository.
- Expand the Advanced section.
- Check the box for "Enable quiet period" and enter "30" in the text field.
- Save the changes.
For more detailed instructions for all linked repository types available to Bamboo see Linking to source code repositories.
Resolution B: Upgrade the Group Agent Plugin to version 1.7 or greater
- Go to Administration > Add-ons
- Find "bamboo-group-agent" in the list of installed plugins
Click "Update" and wait for the process to complete.
- Restart Bamboo for the plugin changes to take effect.
For full details see Installing Marketplace apps.
Resolution C: Change bamboo.send.filenames.to.agent to false
- Edit the file
BAMBOO_INSTALL/conf/wrapper.conf
Find the lines that start with wrapper.java.additional and add another line, incrementing the number that follows. Example:
wrapper.java.additional.1=-Dorg.eclipse.jetty.xml.XmlParser.Validating=false wrapper.java.additional.2=-XX:MaxPermSize=256m wrapper.java.additional.3=-Djava.awt.headless=true wrapper.java.additional.4=-Djava.io.tmpdir=%WINDIR%/Temp
Add another line beginning with
wrapper.java.additional.
plus the next number in the sequence, followed by=-Dbamboo.send.filenames.to.agent=false
}. Using the example above this would look like:wrapper.java.additional.5=-Dbamboo.send.filenames.to.agent=false