partkeepr / PartKeepr

Open Source Inventory Management
http://www.partkeepr.org
GNU General Public License v3.0
1.38k stars 401 forks source link

null 'mimetype' while Setting up the default footprints #963

Open CodeLenny opened 6 years ago

CodeLenny commented 6 years ago

System Information

How to reproduce

During setup (1/2), stage "Setting up the default footprints" fails with "Footprint creation error", and produces the following error message:

An exception occurred while executing 'INSERT INTO FootprintImage (type, filename, originalname, mimetype, size, extension, description, created, footprint_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["footprint", "cb9af118-5550-11e8-8e34-a7bd2bc9ff26", "CBGA-32.png", null, 23365, "png", null, "2018-05-11 15:23:33", 37]:

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'mimetype' cannot be null

Drachenkaetzchen commented 6 years ago

This is because of a bug in the upstream doctrine library we use, see https://github.com/doctrine/doctrine2/issues/6565

Right now, the only recommendation I have is to use an older MariaDB Version. Upgrading to a more recent doctrine version is complicated, as many changes in PartKeepr would need to be done (dependency hell).

CodeLenny commented 6 years ago

Thanks for the information! I've tried:

All failed with the same error. (And mysql:8.0.11 didn't like the authentication method.)

Do you have a known working version? Otherwise, do you know of any other fixes? Thanks!

Drachenkaetzchen commented 6 years ago

Okay that's very odd. I can confirm that PartKeepr runs up to at lesat mysql 5.6.30, so maybe the bug looks similar to the upstream bug, but is actually a different thing? I'll have a look what possible other causes the issue could have

Drachenkaetzchen commented 6 years ago

Okay, it seems that mime type detection does not work on your system. We actually use the Symfony2 implementation, which usually handles most cases. As you run docker, maybe there are some things missing, like the mime type database?

CodeLenny commented 6 years ago

Thank you, you nailed it on the head! I was missing php7-fileinfo.

I got past "Setup (1/2)", but "Setup (2/2)" failed when "Setting up the admin user":

"Notice: iconv(): Wrong charset, conversion from `ASCII' to `UTF-8/IGNORE' is not allowed

And that error went away after I installed php7-mbstring (and php7-iconv?)

Thanks, everything is working now!

Drachenkaetzchen commented 6 years ago

I'll reopen the issue to check at least for the fileinfo functions

CodeLenny commented 6 years ago

Sounds good, thanks!