Bamboo Restore Fails Reporting "Unable to delete directory"

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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

Symptoms

When running a Bamboo Import/Restore, the procedure fails and the following is reported in the logs:

1 2 3 4 5 6 7 8 9 10 11 12 13 2012-06-06 13:20:25,714 WARN [qtp999479248-16] [XmlMigrator] Error deleting directories. Import halted. java.io.IOException: Unable to delete directory E:\bamboo-home\xml-data\build-dir\PROJ-PLAN-JOB\folder_name. at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:984) at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1384) at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1047) at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:978) at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1384) at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1047) at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:978) at com.atlassian.bamboo.migration.XmlMigrator.importXml(XmlMigrator.java:146) at com.atlassian.bamboo.migration.XmlMigrator$$FastClassByCGLIB$$b6578fc7.invoke(<generated>) at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:694)

Cause

Builds are still being run by the Bamboo Server when the Administrator tries to Import/Restore the backup file. Some data files are still open and being read/written by Bamboo as builds may still be running.

Resolution

Since an Import/Restore will remove all the existing data before restoring it using the backup file, the administrator needs to make sure that builds are not being run any more. This can be done using the "Pause Server" option under Administration menu >> Plugin Manager >> "Pause Server" button. Once clicked, message "The server is Paused. No builds will be run or queued" is displayed at the top of the page with a "Resume Server" button.

When the Import/Restore is completed, at the top of the page, click on "Resume Server". This will allow builds to be run again.

Updated on April 11, 2025

Still need help?

The Atlassian Community is here for you.