-
Notifications
You must be signed in to change notification settings - Fork 50
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
Error: "Could not load any valid magic files" #142
Comments
The only "dependency" is that any custom (including OS-provided) magic database file be compatible with the version of libmagic included in You might also check that there isn't something like a |
I see thanks. Looks like we have a bit of investigating to do then. Is there some way of forcing it to use the built-in db, and ignore any system ones? |
Do you have a way to reliably reproduce the issue that I can use on my end? |
Not yet, but hopefully will shortly and will post here. Thanks. |
@mscdex So after further investigation it seems that the issue is with our build servers or process. It's only the pre-built binaries that are suffering from this problem. We are looking into it now. |
@mscdex Just a short update. We've narrowed it down to the pkg package, which we are using to bundle the project into an executable. Even though the |
@srlowe I'm having the same problem, the my pkg bundled executable doesn't seem to be able to see the Did you ever find a solution? |
This happens because PKG creates an "snapshot" file system in memory. The NodeJS runtime inside pkg is modified to read correctly from this in memory file system. But it has no control over the C code that the magic library uses to read files. Therefore the Magic library looks in paths that do not exist in the normal file system. According to the Magic docs, the mmmagic project can fix this by first reading the magicFile property into a buffer. Then pass that buffer as the first argument to the Magic call. I got around this by including the node_modules/mmmagic/magic/magic.mgc file next to the compiled PKG output. Then do this...
|
We have user reports of failures on Fedora 30 and Debian 9.11 with
Error: "Could not load any valid magic files"
.Are there some extra dependencies that need to be installed for some distributions?
The text was updated successfully, but these errors were encountered: