Cannot upload SQL files to JIRA on Windows

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

  1. All attempts to upload SQL files to issues fail
  2. Attempts generate red error text: Unknown Server Error (500).

The following appears in the atlassian-jira.log:

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'.

Resolution

  1. Remove pgAdmin from your system as this is the root cause of the problem
  2. 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:
    1. Perform the following select on your database:

      select * from fileattachment where filename like '%.sql' and mimetype = 'text\plain';
    2. Review the results to ensure these are the problematic files
    3. Perform the following update on your database:

      update fileattachment set mimetype = 'text/plain' where filename like '%.sql' and mimetype = 'text\plain';
  3. While we cannot recommend it, there is some possibility that a registry edit would be able to resolve this issue.

Last modified on Mar 30, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.