CSV Import Fails Due to 'sun.io.MalformedInputException'

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 trying to import issues via CSV the following error is thrown and the import fails:

1 2 3 4 5 6 7 Only new Users will be imported FAILED: Unexpected failure occurred. Importer will stop immediately. Data maybe in an unstable state com.atlassian.jira.exception.DataAccessException: com.atlassian.jira.imports.csv.ImportException: sun.io.MalformedInputException at com.atlassian.jira.imports.csv.CsvDataBean.populateCache(CsvDataBean.java:201) ... Caused by: sun.io.MalformedInputException at sun.io.ByteToCharUTF8.convert(ByteToCharUTF8.java:149) ... at com.atlassian.jira.imports.csv.MindProdCsvProvider.getNextLine(MindProdCsvProvider.java:87)

Cause

This error is thrown when the system encoding is in UTF-8 but the CSV file is in a different character encoding.

Resolution

In JIRA 4.4 and later,

Make sure to select the correct encoding when importing.

Prior to JIRA 4.4,

  1. On Unix/Linux, check the encoding of the CSV using the file command:

    1 2 $ file mycsvfile.csv mycsvfile.csv: ISO-8859 English text, with very long lines, with CRLF, LF line terminators
  2. Once you have determind the encoding of the file, you can use the inconv command to change the encoding:

    1 $ iconv -f ISO-8859-1 -t UTF-8 mycsvfile.csv > myutf8csvfile.csv

    Alternatively, use your spreadsheet program to export the CSV file into UTF-8. Consult Microsoft's site for more information.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.