Bamboo Restore Fails Reporting "Unable to delete directory"

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

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

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.

Last modified on Nov 21, 2012

Was this helpful?

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