Metadata Import Error: Invalid mime type "null":

Dear Support,
We are running DHIS2 ver 2.30, recently upgraded from 2.29. We ran the upgrade scripts on the database right from 2.28 and 2.29.

We were trying to import indicator metadata in JSON format using the import export app and got this error:
Invalid mime type “null”: does not contain ‘/’

Both the dry run and full run give this same issue. We cannot seem to find any other report of this on the community and on JIRA.

Can someone please help us out.

Thank you.

3 Likes

Hi @ifeanyiokoye,

I think maybe @viet can assist you.

2 Likes

Ok. I will wait for @viet

Thank you.

1 Like

Hi @ifeanyiokoye,

Does your file include an extension? I’ve just encountered the same error (Invalid mime type “null”: does not contain ‘/’) with an XML metadata import file, and putting the extension .xml on the upload fixed the problem (I didn’t have an extension on that file before).

If that fixes the problem, I would consider reporting this as a bug, as if you’ve selected the format as ‘XML’ or ‘JSON’, then DHIS2 should really use that to determine the file’s import type, rather than the extension. (Or alternatively, we could remove this ‘format’ selector from the import screen, since it no longer seems to affect anything.)

Cheers, Sam.

2 Likes

Hello @SamuelJohnson, my file is a JSON export from another DHIS2 instance in ZIP format. I just exported form one instance and imported in the other as I have always done. We have recently upgraded to 2.30 and this is the first time trying the metadata import in this new version.
Also the file in the ZIP folder reads metadata.json, so I am not sure what is going on.

2 Likes

@ifeanyiokoye I couldn’t reproduce this on play/2.30
Could you try with latest build of 2.30 ? Or if you could, please send me the file so I can try to reproduce the error (viet@dhis2.org)

1 Like

Hi All,

We are experiencing the same issue and renaming the zipped upload file to include the format solved the issue.

In 2.29, our workflow would be to export data elements in a zipped format, unzip, modify, then import the modified values. However, if you download “data.csv.zip”, unzip it, modify it, then use Windows/WinRAR/Winzip/etc to send the data.csv file to a zipped image, it is named “data.zip” which will fail the upload in 2.30. Renaming the file to “data.csv.zip” correctly imports the data.

3 Likes

Hi all, is the consensus that this should be reported as a bug? If the format is selected as an option during the import, then surely the code should use that, rather than the file extension, to determine the format?

2 Likes

Should you rename the file with the extension e.g. data.zip.csv or data.csv.zip.
I have been working with a zipped file with the .csv extension at the end but not .zip

2 Likes

Hello @tiha data.csv.zip should be the way to go

2 Likes