XML Import fails with IOException No Such File or Directory
症状
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:
atlassian-jira.log
に次のエラーが返される。
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)
原因
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.
ソリューション
- Create a backup of your XML backup (typically
entities.xml
). - Open up the backup in a text editor.
If it is a large backup (greater than 100mb) using vim is recommended. Search for
propertyKey="jira.path.attachments"
and note theid
. In the below example, theid
is 10014.<OSPropertyEntry id="10014" entityName="jira.properties" entityId="1" propertyKey="jira.path.attachments" type="5"/>
Search for
OSPropertyString id="<the id from above>"
, for example 10014 will return the following:<OSPropertyString id="10014" value="/usr/local/jira4/jira_home/data/attachments"/>
Modify the value to the appropriate attachment path. For example:
<OSPropertyString id="10014" value="/opt/atlassian/jira/data/attachments"/>
Import the modified XML backup.
- Ensure that the attachments are migrated across from the old version of JIRA to the new one.