XML Import fails with IOException No Such File or 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 restoring a JIRA backup from XML it fails without completing with a "java.lang.IllegalStateException: java.io.IOException: No such file or directory" error, as below:

(Auto-migrated image: description temporarily unavailable)

The following appears in the atlassian-jira.log:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 2012-09-08 04:15:26,608 JiraImportTaskExecutionThread-1 INFO anonymous 255x35x1 a1k5kl 10.61.2.249,10.61.5.30 /secure/SetupImport.jspa [jira.bc.dataimport.DefaultDataImportService] Importing data is 20% complete... 2012-09-08 04:15:26,779 JiraImportTaskExecutionThread-1 INFO anonymous 255x35x1 a1k5kl 10.61.2.249,10.61.5.30 /secure/SetupImport.jspa [jira.bc.dataimport.DefaultDataImportService] XML successfully parsed. 2012-09-08 04:15:26,786 JiraImportTaskExecutionThread-1 ERROR anonymous 255x35x1 a1k5kl 10.61.2.249,10.61.5.30 /secure/SetupImport.jspa [jira.bc.dataimport.DefaultDataImportService] Error importing data: java.lang.IllegalStateException: java.io.IOException: No such file or directory java.lang.IllegalStateException: java.io.IOException: No such file or directory at net.java.ao.db.FileSystemUtils$1.get(FileSystemUtils.java:43) at net.java.ao.db.FileSystemUtils$1.get(FileSystemUtils.java:24) at com.google.common.base.Suppliers$MemoizingSupplier.get(Suppliers.java:109) at net.java.ao.db.FileSystemUtils.isCaseSensitive(FileSystemUtils.java:50) at net.java.ao.db.MySQLDatabaseProvider.isCaseSensitive(MySQLDatabaseProvider.java:141) at net.java.ao.schema.helper.DatabaseMetaDataReaderImpl.getTableNames(DatabaseMetaDataReaderImpl.java:60) at net.java.ao.schema.ddl.SchemaReader.readSchema(SchemaReader.java:92) at net.java.ao.schema.ddl.SchemaReader.readSchema(SchemaReader.java:80) at net.java.ao.schema.ddl.SchemaReader.readSchema(SchemaReader.java:71) at com.atlassian.activeobjects.backup.ActiveObjectsDatabaseCleaner.doCleanup(ActiveObjectsDatabaseCleaner.java:61) at com.atlassian.activeobjects.backup.ActiveObjectsDatabaseCleaner.cleanup(ActiveObjectsDatabaseCleaner.java:46) at com.atlassian.activeobjects.backup.ActiveObjectsBackup.clear(ActiveObjectsBackup.java:170) at com.atlassian.jira.bc.dataimport.DefaultDataImportService.removeActiveObjects(DefaultDataImportService.java:855) at com.atlassian.jira.bc.dataimport.DefaultDataImportService.performImport(DefaultDataImportService.java:564) at com.atlassian.jira.bc.dataimport.DefaultDataImportService.doImport(DefaultDataImportService.java:239) at com.atlassian.jira.web.action.setup.DataImportAsyncCommand.call(DataImportAsyncCommand.java:65) at com.atlassian.jira.web.action.setup.DataImportAsyncCommand.call(DataImportAsyncCommand.java:28) at com.atlassian.jira.task.ImportTaskManagerImpl$TaskCallableDecorator.call(ImportTaskManagerImpl.java:147) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at com.atlassian.multitenant.impl.DefaultMultiTenantManager.runForTenant(DefaultMultiTenantManager.java:61) at com.atlassian.multitenant.juc.MultiTenantExecutors$WrappedRunnable.run(MultiTenantExecutors.java:160) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: java.io.IOException: No such file or directory at java.io.UnixFileSystem.createFileExclusively(Native Method) at java.io.File.checkAndCreate(File.java:1704) at java.io.File.createTempFile(File.java:1792) at java.io.File.createTempFile(File.java:1828) at net.java.ao.db.FileSystemUtils$1.get(FileSystemUtils.java:29)

Cause

The attachment path in the XML backup is not valid. This would normally generate a different error, however in this certain use case it has not.

Resolution

  1. Create a backup of your XML backup (typically entities.xml).

  2. Open up the backup in a text editor.

    ℹ️ If it is a large backup (greater than 100mb) using vim is recommended.

  3. Search for propertyKey="jira.path.attachments" and note the id. In the below example, the id is 10014.

    1 <OSPropertyEntry id="10014" entityName="jira.properties" entityId="1" propertyKey="jira.path.attachments" type="5"/> 
  4. Search for OSPropertyString id="<the id from above>", for example 10014 will return the following:

    1 <OSPropertyString id="10014" value="/usr/local/jira4/jira_home/data/attachments"/> 
  5. Modify the value to the appropriate attachment path. For example:

    1 <OSPropertyString id="10014" value="/opt/atlassian/jira/data/attachments"/> 
  6. Import the modified XML backup.

  7. Ensure that the attachments are migrated across from the old version of JIRA to the new one.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.