anvc / scalar

Born-digital, open source, media-rich scholarly publishing that’s as easy as blogging.
Other
231 stars 73 forks source link

Media upload sometimes silently fails #57

Closed crism closed 7 years ago

crism commented 7 years ago

Using Scalar 2.3 in our own installation (downloaded from GitHub).

A user is testing the system, uploading a series of JPEG images into her book. Some files succeed: the file uploads, a thumbnail is created on the filesystem, a database entry is created, and her browser is forwarded to the Scalar page for that asset.

Some files succeed but hang: a thumbnail is created, as is a database entry, but the browser hangs on the import page. Returning manually to the dashboard shows the asset as present.

One file, at least fails: the thumbnail is created on the system, but no database entry is created. The upload page hangs as above, but returning to the dashboard does not show the asset (predictably, since it’s not in the database). Interestingly, the thumbnail created is identical to the uploaded file—this has been reproduced with multiple uploads of the file under different filenames.

The broken file is attached.

I’m investigating this in our local installation, but help would be appreciated. It seems to be different from the issue described in #54.

craigdietrich commented 7 years ago

Hi @crism,

The file in question is relatively small, but it is over 1 meg which is kind of large for a web image. It could be that your webserver is blocking uploads for files larger than a Megabyte. (I'd be surprised if this was the case, though, as, 2, 8, or 128 megs are typically the default.)

If you're familiar with the Web Inspector in your browser, or Firebug for Firefox: both will reveal the requests sent to the server with the file payload. In the event that it fails, you should be able to expand the request and see if there's any information that can be gleaned from the return. For example, there might be PHP error in the return content from Scalar. I don't think we have it set up to fail gracefully, but file uploads are typically a little off in their error handling anyways so it could be the server is not reporting to Scalar correctly, and Scalar is thus throwing a generic PHP error.

If neither of these apply, can you send a note to us here: http://scalar.usc.edu/contact with details (attn: Craig)? I'm sure we can get this worked out!

crism commented 7 years ago

@craigdietrich: Our limit is currently set to 2 MB. The troublesome file is successfully uploaded to the server—it can be seen on the server filesystem, and a thumbnail is created (though identical to the original). A larger file (1.6 MB) succeeds, as well; there’s something odd about this one. At a minimum, though, the error handling should be more robust. There’s nothing in the server error logs; whatever is breaking does so silently.

I’ll drop a note at the ANVC contact page, too.

craigdietrich commented 7 years ago

@crism Okay let's follow up through the contact page! (I'll close this ticket for now.)

crism commented 7 years ago

Hi, @craigdietrich—I never got any followup from this conversation.