Icon.svg to be of type "text/plain". Only "image/jpeg, image/png, image/svg+xml" are allowed

I get a weird error when trying to push metadata.

$ snap download foliate --edge
$ snapcraft push-metadata foliate_82.snap
Pushing metadata from 'foliate_82.snap'
Received 415: 'The icon "icon.svg" to be of type "text/plain". Only "image/jpeg, image/png, image/svg+xml" are allowed.'

Why is this SVG file seen as text/plain instead of image/svg+xml?

This is the icon from the snap:


The wording on the error is not a properly formed English sentence, too :slight_smile:

1 Like

@store - can someone look at this? This error is not coming from the review-tools. Locally, file for Ubuntu 16.04, 18.04 and 20.04 all show this as svg. Perhaps the tool on the release of Ubuntu on which this check is being performed is misdetecting this?

1 Like

Could a bug please be filed at Bugs : Snap Store Server?

This message does NOT come from the tools, it’s a basic store-side MIME type check in the metadata API endpoint.

What’s happening here is apparently snapcraft using the wrong mime type in the HTTP request, bears looking at how snapcraft determines type of metadata files it’s going to upload, but a proper bug on Launchpad will make it easier to involve the appropriate projects.

If better wording for the error is suggested, we can implement that as well :slight_smile: I concur it reads weird.

  • Daniel
1 Like


1 Like

@roadmr Did anything change on the store side?

I tried to reproduce with the icon above and upload-metadata worked for me…

We haven’t changed the confusing string.

A bug was filed, it’s likely snapcraft was tweaked to send the correct mime type, which is why this now works.

  • Daniel

@roadmr Hrm. Well I was trying to reproduce it so I can fix it in snapcraft, but it seems to work for me with snapcraft 3.11 and 4.x.