CSV import error: Unexpected failure occurred. Importer will stop immediately. Data may be in an unstable state (Jira Data Center)
Platform Notice: Data Center Only - This article only applies to Atlassian apps 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
Summary
While performing an External System Import from a CSV file in Jira, the following error is encountered:
"Unexpected failure occurred. Importer will stop immediately. Data may be in an unstable state"

Don't panic: Despite the wording "Data may be in an unstable state", this error results in a failed import only — it does NOT corrupt your database. This misleading message is tracked in JRASERVER-72462. Your existing data is safe.
Environment
All versions of Jira Software Datacenter
Diagnosis
Scenario 1: Multi-context custom field
The following ERROR message can be found by clicking the link below the error under What now?:
You can "download a detailed log" of this import. The error will appear similar to the example below:
2021-05-28 17:23:50,425 INFO - ------------------------------
2021-05-28 17:23:50,425 INFO - Finished Importing : Issues
2021-05-28 17:23:50,425 INFO - ------------------------------
2021-05-28 17:23:50,425 ERROR - Unexpected failure occurred. Importer will stop immediately. Data may be in an unstable state
java.lang.IllegalArgumentException: expected one element but was: <com.atlassian.jira.issue.fields.config.FieldConfigSchemeImpl@5fcbbee4, com.atlassian.jira.issue.fields.config.FieldConfigSchemeImpl@e859a2e4>
at com.google.common.collect.Iterators.getOnlyElement(Iterators.java:316)
at com.google.common.collect.Iterables.getOnlyElement(Iterables.java:254)
at com.atlassian.jira.plugins.importer.imports.importer.impl.customfields.CustomFieldsUtil.associateCustomFieldWithIssueType(CustomFieldsUtil.java:272)
at com.atlassian.jira.plugins.importer.imports.importer.impl.customfields.CustomFieldsUtil.makeSureCustomFieldIsApplicableForIssue(CustomFieldsUtil.java:153)
at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.importExternalCustomFields(DefaultJiraDataImporter.java:1264)
at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.createIssue(DefaultJiraDataImporter.java:911)
at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.importIssues(DefaultJiraDataImporter.java:798)
at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.doImport(DefaultJiraDataImporter.java:414)
at com.atlassian.jira.plugins.importer.imports.importer.impl.ImporterCallable.call(ImporterCallable.java:26)
at com.atlassian.jira.plugins.importer.imports.importer.impl.ImporterCallable.call(ImporterCallable.java:15)
at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:533)
at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:491)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.atlassian.jira.task.ForkedThreadExecutor$ForkedRunnableDecorator.run(ForkedThreadExecutor.java:216)
at java.lang.Thread.run(Thread.java:748)
2021-05-28 17:23:50,427 INFO - No issues need to be reindexed.Scenario 2: Indexing failure
The following ERROR message can be found by clicking the link below the error under What now?:
You can "download a detailed log" of this import. The error will appear similar to the example below:
2022-03-09 20:28:41,832 ERROR - Unexpected failure occurred. Importer will stop immediately. Data may be in an unstable state
com.atlassian.jira.index.IndexingFailureException: Indexing completed with 1 errors
at com.atlassian.jira.index.AccumulatingResultBuilder$CompositeResult.await(AccumulatingResultBuilder.java:189)
at com.atlassian.jira.issue.index.DefaultIndexManager.obtain(DefaultIndexManager.java:896)
at com.atlassian.jira.issue.index.DefaultIndexManager.await(DefaultIndexManager.java:876)
at com.atlassian.jira.issue.index.DefaultIndexManager.executeWithIndexLock(DefaultIndexManager.java:863)
at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexIssues(DefaultIndexManager.java:651)
at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexIssues(DefaultIndexManager.java:630)
at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexIssues(DefaultIndexManager.java:614)
at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexIssues(DefaultIndexManager.java:459)The keyword is IndexingFailureException, indicating the error was when trying to index the newly created issue(s).
Cause
Scenario 1: Multi-context custom field
This error occurs when a target custom field has more than one context associated with it. This is a known limitation tracked in JRASERVER-64595.
Scenario 2: Indexing failure
The Jira search index is out of sync or corrupted, preventing the importer from writing new issue associations.
Solution
⚠️ Important Note: Despite the note "Data may be in an unstable state", the outcome of this problem is a failed import. It will NOT result in database instability. JRASERVER-72462 Data may be in an unstable state ERROR logging is alarming was raised for the error handling.
Scenario 1: Multi-context custom field
During the "Map fields" step of the CSV import, choose "Don't map this field" for the affected custom field. Alternatively, navigate to ⚙ > Issues > Custom fields and reduce the field to a single global context before retrying the import.
Scenario 2: Indexing failure
Reindex Jira (background if single-node or full lock & reindex if in a cluster) and try the CSV import again.
Related articles
JRASERVER-72462 (Misleading "unstable state" error)
Was this helpful?