mimemagicrb/mimemagic

Mimemagic Gem version 0.3.10 not working with Azure App Service

codeface opened this issue · 4 comments

Since the big yanking of last week, I've updated my apps to use the new Gem version 0.3.10. This works fine locally, but my deployed apps on Azure App service get broken. It appears to get past the deployment step but then visiting the apps gives an error, and in the logs it says: Could not find MIME type database in the following locations: ...

Any suggestions for things I could try in order to get my apps working on Azure app service again?

Checkout this code

https://github.com/mimemagicrb/mimemagic/blob/master/ext/mimemagic/Rakefile#L6

You need to have the library shared-mime-info installed.

Thanks @Skulli. I'm not sure how much control we have over what system libraries get installed using the vanilla Azure App Service build service. (Or did you mean we could achieve this with a Gem?)

Or maybe the necessary files are already available somewhere in the container and we need to figure out where, and set an ENV variable. I'll look into that.

Just to summarise:

  • We're using Rails 5.2 on Azure App Service
  • We're using the default Azure build service
  • Pushing code to Azure worked fine until last week when the mimemagic Gems were yanked
  • After the yank, any push (regardless of whether related to Gems) leaves the app in a completely broken state (as Azure build service needs to do a bundle install on every deploy)
  • Updating the mimemagic Gem to 0.3.10 doesn't fix the problem, because of the Could not find MIME type database in the following locations: ... error mentioned above

I'm guessing this must be affecting other Azure App Service users, as we're not doing anything very fancy.

(Update: just spotted that Rails 5.2.5 was released late on Friday. I'm going to try that instead of messing around trying to get mimemagic 0.3.10 to work)

Alternative would be to get the freedesktop.org.xml by yourself, put it on your vm and export the environment variable to its path FREEDESKTOP_MIME_TYPES_PATH. I have no experience with azure though.

I think @Skulli 's way could work, make a copy https://cgit.freedesktop.org/xdg/shared-mime-info/tree/freedesktop.org.xml.in?h=Release-1-9 to somewhere you run you app on azure. then set it to FREEDESKTOP_MIME_TYPES_PATH,

--update
actually just found in the latest readme, author mentioned it.