server issue
avatar slibbe
slibbe
17 Mar 2016

When creating (or adding to) an issue it would be nice to include the Joomla systeminfo file.

Steps to reproduce the issue

In issue 'Add files' > browse to systeminfo_etc.json > file type not allowed.

browse to systeminfo_etc.txt > incorrect MIME-type.

Expected result

Correctly attaching systeminfo-file.

Actual result

In case of .json : file type not allowed
In case of .txt : incorrect MIME-type.

System information (as much as possible)

Additional comments

avatar slibbe slibbe - open - 17 Mar 2016
avatar mbabker
mbabker - comment - 17 Mar 2016

The application only supports uploads for what GitHub will support. GitHub doesn't support JSON files right now so that error's to be expected. Still looking on the TXT file issue.

avatar b2z
b2z - comment - 17 Mar 2016

@mbabker may be TXT is not added to config file?

avatar mbabker
mbabker - comment - 17 Mar 2016

It is.

avatar b2z
b2z - comment - 17 Mar 2016

That's interesting - I have no problem adding it on my testing server.

avatar mbabker
mbabker - comment - 17 Mar 2016

Nor me locally.

avatar mbabker
mbabker - comment - 17 Mar 2016

Found the issue. At least in my case, the server is uploading it with a text/x-c++ MIME.

avatar mbabker mbabker - change - 17 Mar 2016
Labels Added: server issue
avatar mbabker
mbabker - comment - 17 Mar 2016

Well I've added some logging to the uploader so now in the app.log we'll get some data on why uploads fail.

avatar mbabker
mbabker - comment - 18 Mar 2016

I've attached here the file I'm testing with (which is coming out of Joomla via the system info export feature). It uploads fine in GitHub and on my localhost. @b2z I couldn't upload it on your system, got the MIME error. So my guess is some kind of PHP or Apache setting is giving us issues, I just don't know what. I also filed a ticket with hosting to see if they have any ideas.

Interestingly enough, Joomla's LICENSE.txt file wouldn't upload either; that tried to upload with a text/x-pascal MIME.

systeminfo-2016-03-17T10-08-09-04-00.txt

avatar mbabker
mbabker - comment - 18 Mar 2016

So, random question. Do we actually NEED the MIME type validation? https://help.github.com/articles/file-attachments-on-issues-and-pull-requests/ seems to imply the answer is no.

avatar mbabker
mbabker - comment - 18 Mar 2016

@b2z What's your server's fileinfo PHP configuration? Specifically I'm interested in whether you've got libmagic enabled and what version if so.

avatar b2z
b2z - comment - 19 Mar 2016

@mbabker nothing special there:

fileinfo support = enabled
version = 1.0.5

I'm running PHP 5.4.45. Weird issue :(

avatar mbabker
mbabker - comment - 19 Mar 2016

It's the libmagic library that makes a difference. With it, uploads with different MIME types on .txt files is fine. Without it, basically whatever MIME the file has is what gets used in the end. So it's definitely environmental.

Now the issue is how do we deal with not having that library consistently available? The MIME validations we have are going to be too strict with what the CMS is exporting right now.

avatar b2z
b2z - comment - 20 Mar 2016

Lets drop the validation completely or for .txt only?

avatar mbabker
mbabker - comment - 20 Mar 2016

For .txt I'd say skip it for the short term. The Joomla servers running PHP 5.6 have libmagic installed so they wouldn't hit this issue (and it looks like it might be a general PHP change between 5.5 and 5.6; all my 5.5 environments don't have that library yet 5.6 does). So once the server gets upgraded we're good.

avatar mbabker
mbabker - comment - 25 Mar 2016

Workaround merged.

avatar mbabker mbabker - change - 25 Mar 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-03-25 19:58:21
Closed_By mbabker
avatar mbabker mbabker - close - 25 Mar 2016

Add a Comment

Login with GitHub to post a comment