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

Exporting users warns magic.mime is missing #49

Closed
marcbria opened this issue Sep 15, 2021 · 2 comments
Closed

Exporting users warns magic.mime is missing #49

marcbria opened this issue Sep 15, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@marcbria
Copy link
Collaborator

marcbria commented Sep 15, 2021

When exporting users, log shows the following warning:

PHP Warning:  finfo_open(/etc/magic.mime): failed to
 open stream: No such file or directory in /var/www/html/lib/pkp/classes/core/PKPString.inc.php on line 318, referer: http://ada.uab.cat:811
7/languesparole/management/importexport/plugin/UserImportExportPlugin

This warning raises when OJS calls fileinfo functions: https://www.php.net/manual/es/class.finfo.php

A preliminary search points that libmime is missing but installing it via "file" package ("apk add --no-cache file") makes no real difference.

When running "file -version" I got the path of the magic file (not magic.mime but I suspect will do the job) and it's /usr/share/misc/magic.

A possible solution would be change the dockerfile to add "file" and link "/etc/magic.mime" to "/usr/share/misc/magic" but I'm not sure about side effects.

I'm not sure if this only happens with 3.2.1-4 over php 7.3 or is a general issue.

In short: although this is just a warning and I can see any real impact in the application functionality... more research is required.

@marcbria
Copy link
Collaborator Author

Ubuntu includes a /etc/magic.mime that is empty.
A touch on /etc/magic.mime removes the warning but would be nice to have mime support.

Installing imagemagick (apk --update add imagemagick) adds a new mime folder.
Linking /usr/share/mime/magic to /etc/magic.mime also fixes the warning.

Installing libmagic to test... and I can't see any new new magic.mime file.

Not sure about what solution would be better.

Kind of related with #33

@marcbria
Copy link
Collaborator Author

marcbria commented Nov 25, 2022

Looks like apache includes a mime file.
Linking /etc one to apache fixes the issue:

$ ln -s /etc/apache2/magic /etc/magic.mime

Anyway, as far as we are going to move from alpine to debian-slim it won't be required anymore.

@marcbria marcbria added outdated The issue refers to old versions and won't be fixed. bug Something isn't working and removed outdated The issue refers to old versions and won't be fixed. labels Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant