Builds cancelled due to marked as queued but not present in the queue for 720 seconds

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible


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.


There are multiple causes of this problem, each with a different solution.

Cause A: Multiple builds triggered at the same time in versions older than 6.2.2

Post-commit triggers are superior to polling because they reduce the 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-17890 - Getting 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 '[[], SingleParameterMethodListenerInvoker{method=public void,}]' 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 is set to true which sometimes results in problems adding builds to the queue.  This setting only affects Bamboo versions less than 5.0 and is already deprecated.

Cause D: The agent may have the wrong file/folder permissions and ownership

You may find a java.lang.IllegalStateException: Agent working directory is not a directory message in the Agent logs <bamboo-agent-home>/atlassian-bamboo-agent.log. That error means the Bamboo agent cannot write to a specific location within its work structure. This is an indicator of wrong file permissions and/or incorrect ownership.

This is a very common problem and happens when the Agent is inadvertently started with a user other than the regular Bamboo Agent user (E.g. root)

2021-09-23 19:30:31,212 ERROR [] [BuildAgentControllerImpl] Unknown exception occurred on ''. Agent will attempt to recover its normal operation...
io.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.IllegalStateException: Agent working directory is not a directory
	at io.atlassian.util.concurrent.LazyReference.getInterruptibly(
	at io.atlassian.util.concurrent.LazyReference.get(
	at com.atlassian.bamboo.utils.BambooRunnables$
Caused by: java.lang.IllegalStateException: Agent working directory is not a directory
	at io.atlassian.util.concurrent.LazyReference$
	at io.atlassian.util.concurrent.LazyReference.getInterruptibly(
	... 10 more

Cause E: No space left on device

We had reports from customers that this issue might happen when the Agent has not enough free space left on the <bamboo-agent-home> location.

Cause F: Too many full Agents recalculations in parallel

Recalculation messages are printed in a timeframe very close to the "720s" events. These recalculations of type "AgentAssignmentsUpdatedEvent" are called when there is an update that will effect all Agents. For example, disabling/enabling all agents or updating capability sets. As no Agents will pickup from the Queue when it gets rewritten that may cause the "720s" if it lasts for too long. This is better described on BAM-25145 - Getting issue details... STATUS .

2023-10-03 21:30:52,125 INFO [AtlassianEvent::0-BAM::EVENTS:pool-2-thread-17] [BuildQueueManagerImpl$1] Recalculation #4 started
2023-10-03 21:32:54,959 INFO [AtlassianEvent::0-BAM::EVENTS:pool-2-thread-17] [BuildQueueManagerImpl$1] Recalculation #4 took 2.047 min

2023-10-03 21:33:03,418 INFO [AtlassianEvent::0-BAM::EVENTS:pool-2-thread-64] [BuildQueueManagerImpl$1] Recalculation #5 started
2023-10-03 21:35:17,558 INFO [AtlassianEvent::0-BAM::EVENTS:pool-2-thread-64] [BuildQueueManagerImpl$1] Recalculation #5 took 2.236 min

2023-10-03 21:35:17,559 INFO [AtlassianEvent::0-BAM::EVENTS:pool-2-thread-10] [BuildQueueManagerImpl$1] Recalculation #6 started
2023-10-03 21:37:44,734 INFO [AtlassianEvent::0-BAM::EVENTS:pool-2-thread-10] [BuildQueueManagerImpl$1] Recalculation #6 took 2.453 min

2023-10-03 21:37:44,735 INFO [AtlassianEvent::0-BAM::EVENTS:pool-2-thread-35] [BuildQueueManagerImpl$1] Recalculation #7 started
2023-10-03 21:40:25,668 INFO [AtlassianEvent::0-BAM::EVENTS:pool-2-thread-35] [BuildQueueManagerImpl$1] Recalculation #7 took 2.682 min


Solution A: Add a 30 second quiet period to the linked repository associated with the build plan.

  1. Edit the settings for your linked repository
  2. Expand the Advanced section
  3. Check the box for "Enable quiet period" and enter "30" in the text field
  4. Save the changes

For more detailed instructions for all linked repository types available to Bamboo see Linking to source code repositories.

Solution B: Upgrade the Group Agent Plugin to version 1.7 or greater

  1. Go to Administration > Add-ons
  2. Find "bamboo-group-agent" in the list of installed plugins
  3. Click "Update" and wait for the process to complete

  4. Restart Bamboo for the plugin changes to take effect

For full details see Installing Marketplace apps.

Solution C: Change to false

Apply this solution only if that property is set to true. By default, it is already set to false.

  1. Edit the file $BAMBOO_INSTALL/conf/wrapper.conf
  2. Find the lines that start with and add another line, incrementing the number that follows.  Example:
  3. Add another line beginning with plus the next number in the sequence, followed by}.  Using the example above this would look like this:

Solution D: Investigate and fix the agent's file/folder permissions and ownership

  1. Stop the agent
  2. In Linux, run the following command as root to list the permissions of the <bamboo-agent-home> folders and files. In Windows, you will need to investigate the permissions manually or use PowerShell's Get-Acl/Get-ChildItem

    For directories
    find <bamboo-agent-home> -maxdepth 2 \( -type f -o -type d \) -ls
  3. Based on the output, fix the permissions and ownership of the files and start the Agent

Solution E: Cleanup some disk space or extend the <bamboo-agent-home> filesystem

  1. Stop the agent
  2. Extend or cleanup the <bamboo-agent-home> filesystem
  3. Start the agent

Solution F: There are too many Agents on your Bamboo system

In cases where Bamboo has no proper Agent cleanup routines – mostly on very busy systems – this may lead to thousands, unused Agents left in the Database, forcing Bamboo to recalculate the Queue much more often.

  1. Reduce the number of Agents if possible (data hygiene for inactive Agents). You can run some SQL statements to find unused Agents:
  2. Increase the number of ORPHANED_BUILD_MONITOR_JOB_SCHEDULER_REACTION_DELAY_MULTIPLIER. For that you'd have to add a new system property to Bamboo and with a value between 3 and 20. The multiplier is applied to the following formula:
    • heartbeatTimeoutSeconds (600s) + ( (2) * heartbeatTimeout (60s) ) = 720 seconds
  3. Ultimately, upgrade Bamboo to one of the releases listed as fixed in BAM-25145 - Getting issue details... STATUS

Last modified on Oct 17, 2023

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.