Does anyone from Atlassian have any idea re: why I get this error => csv unexpected import failure

James Malgieri
Contributor
January 15, 2020

This is totally stopping our work - so if anyone has any suggestions or ideas, please let me know.

I'm doing a import of 93 issues into Jira Project via a csv file.  I've done csv imports many times and the data in the csv looks good to me but I'm getting an "ERROR - Unexpected failure occurred" when importing via a csv file.  

2020-01-15 16:48:59,630 INFO - Finished Importing : Issues
2020-01-15 16:48:59,630 INFO - ------------------------------
2020-01-15 16:48:59,630 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@c6e30a89,        com.atlassian.jira.issue.fields.config.FieldConfigSchemeImpl@c6e436d9>

Does anyone have any idea what has gone wrong or where I should look?

Thanks,

Jim

Here's the whole import log with the names redacted.

2020-01-15 16:48:58,130 INFO - Import started by james.malgieri using com.atlassian.jira.plugins.importer.imports.csv.CsvDataBean
2020-01-15 16:48:58,132 INFO - ------------------------------
2020-01-15 16:48:58,132 INFO - Importing: Users
2020-01-15 16:48:58,132 INFO - ------------------------------
2020-01-15 16:48:58,132 INFO - Only new items will be imported
2020-01-15 16:48:58,135 WARN - User <redacted> has an invalid e-mail address [<redacted>], creating user with e-mail noreplay@example.com
2020-01-15 16:48:58,486 INFO - Imported user <redacted> (<redacted>) as an inactive
2020-01-15 16:48:58,487 WARN - User <redacted> has an invalid e-mail address [<redacted>], creating user with e-mail noreplay@example.com
2020-01-15 16:48:58,826 INFO - Imported user <redacted> (<redacted>) as an inactive
2020-01-15 16:48:58,826 INFO - 31 users associated with import. All of them imported as inactive, this can be changed after import in User Access step.
2020-01-15 16:48:58,826 INFO - ------------------------------
2020-01-15 16:48:58,826 INFO - Finished Importing : Users
2020-01-15 16:48:58,826 INFO - ------------------------------
2020-01-15 16:48:58,826 INFO - 2 users successfully created.
2020-01-15 16:48:58,826 INFO - Retrieving projects...
2020-01-15 16:48:58,826 INFO - Project ExternalProject{id='null', key='MYPRJ', externalName='null', name='MyProject 4.0'} exists and found correctly.
2020-01-15 16:48:58,826 INFO - ------------------------------
2020-01-15 16:48:58,826 INFO - Importing: Versions
2020-01-15 16:48:58,826 INFO - ------------------------------
2020-01-15 16:48:58,826 INFO - Only new items will be imported
2020-01-15 16:48:58,826 INFO - ------------------------------
2020-01-15 16:48:58,826 INFO - Finished Importing : Versions
2020-01-15 16:48:58,826 INFO - ------------------------------
2020-01-15 16:48:58,826 INFO - ------------------------------
2020-01-15 16:48:58,826 INFO - Importing: Components
2020-01-15 16:48:58,826 INFO - ------------------------------
2020-01-15 16:48:58,826 INFO - Only new items will be imported
2020-01-15 16:48:58,827 INFO - ------------------------------
2020-01-15 16:48:58,827 INFO - Finished Importing : Components
2020-01-15 16:48:58,827 INFO - ------------------------------
2020-01-15 16:48:58,827 INFO - Retrieving custom fields...
2020-01-15 16:48:58,827 INFO - ------------------------------
2020-01-15 16:48:58,827 INFO - Importing: Issues
2020-01-15 16:48:58,827 INFO - ------------------------------
2020-01-15 16:48:58,827 INFO - Only new items will be imported
2020-01-15 16:48:58,827 INFO - Importing issue: [externalId='autoid-1039881436861619251', summary='Displaying Test String ']
2020-01-15 16:48:59,630 INFO - ------------------------------
2020-01-15 16:48:59,630 INFO - Finished Importing : Issues
2020-01-15 16:48:59,630 INFO - ------------------------------
2020-01-15 16:48:59,630 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@c6e30a89, com.atlassian.jira.issue.fields.config.FieldConfigSchemeImpl@c6e436d9>
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:1274)
at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.createIssue(DefaultJiraDataImporter.java:921)
at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.importIssues(DefaultJiraDataImporter.java:797)
at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.doImport(DefaultJiraDataImporter.java:413)
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:481)
at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:443)
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)
2020-01-15 16:48:59,631 INFO - No issues need to be reindexed.

 

1 answer

1 accepted

0 votes
Answer accepted
James Malgieri
Contributor
January 17, 2020

.

James Malgieri
Contributor
January 28, 2020
java.lang.IllegalArgumentException: expected one element but was: <com.atlassian.jira.issue.fields.config.FieldConfigSchemeImpl@c6e30a89, com.atlassian.jira.issue.fields.config.FieldConfigSchemeImpl@c6e436d9>

For me, "IllegalArgumentException" . .  "expected one element but was:", seemed to be complaining that Jira/JAVA was expecting one element but actually getting something different.  The message doesn't tell me where the problem is - just that something is wrong.  Additionally, the error causes the import to stop and any changes are not saved.

Checking all of the field types against the data in my csv file, it appeared that nothing was incorrect.  After struggling with this for over a week I just went for the brute force approach ==> importing csv data little by little until you find the problem(s).

First: Try importing only the Jira system field data of your csv file.

  • If ithe import doesn't work, try importing less data until you single out the bad field data. 
  • If the import works - save the configuration file and use it as the basis of the next import.

Second: Using the saved config file, re-import the data that previously had no problems and add in a few custom fields

  • If the import is successful - save the config file and repeat adding more custom fields until you get the "expected one element but was: " error.
  • When you do get the error, do not save the config file - only save it on successful imports. Continue to add fields - repeating the process until you have tested all fields through the import process.

Remember to keep saving new config files as you have success.

Hopefully, you'll be able to find out which field(s) are the problem and then you can examine them to find out why they are giving you trouble.

I hope this helps.

Like Adam Sterrie likes this
Adam Sterrie
Contributor
June 23, 2024

Thanks for the suggestion.
This approach worked for us.
It turned out that the Story Points field (Number) was the cause of the error message. Once I left it out of the import mapping, the import worked. 
So frustrating that Atlassian have still not invested more work on improving the import process and made it more admin-friendly. 

Suggest an answer

Log in or Sign up to answer