Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mimemagic Gem version 0.3.10 not working with Azure App Service #156

Open
codeface opened this issue Mar 30, 2021 · 4 comments
Open

Mimemagic Gem version 0.3.10 not working with Azure App Service #156

codeface opened this issue Mar 30, 2021 · 4 comments

Comments

@codeface
Copy link

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?

@Skulli
Copy link

Skulli commented Mar 31, 2021

Checkout this code

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

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

@codeface
Copy link
Author

codeface commented Mar 31, 2021

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)

@Skulli
Copy link

Skulli commented Mar 31, 2021

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.

@xiangzhuyuan
Copy link

xiangzhuyuan commented Apr 2, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants