Cannot upload SQL files to JIRA on Windows
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
Summary
Symptoms
All attempts to upload SQL files to issues fail
Attempts generate red error text: Unknown Server Error (500).
The following appears in the atlassian-jira.log
:
1
java.lang.IllegalArgumentException: Error parsing media type 'text\plain'
Diagnosis
This issue is typically seen in clients that have pgAdmin installed.
Cause
This is caused by incorrect MIME handling by Windows. When installed, the pgAdmin program associates the .SQL file extension with 'text\plain' instead of the traditional 'text/plain'.
Solution
Resolution
Remove pgAdmin from your system as this is the root cause of the problem
Note, this has not been throughly tested, attempt this at your own risk: It is possible to fix these in the database, before an attempt as this please shut down JIRA and backupyour database, then attempt the fix:
Perform the following select on your database:
1
select * from fileattachment where filename like '%.sql' and mimetype = 'text\plain';
Review the results to ensure these are the problematic files
Perform the following update on your database:
1
update fileattachment set mimetype = 'text/plain' where filename like '%.sql' and mimetype = 'text\plain';
While we cannot recommend it, there is some possibility that a registry edit would be able to resolve this issue.
Was this helpful?