Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#37853 closed defect (bug) (duplicate)

HTTP error when uploading images

Reported by: cezariuszmarek's profile cezariuszmarek Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.6
Component: Media Keywords:
Focuses: Cc:

Description

When I upload images to the gallery (using drag&drop) I often get the HTTP error. The image uploaded with error is invalid - it doesn't appear neither in the images attached to the post not in the unattached images. But when I enter the image file name to the search box it appears both in all images and attached images, but it doesn't have a thumbnail (looks like a gray page).
It happens randomly both with small files (200kB) and large ones (2MB). Tested with Chrome 52 and Firefox 48 on Wordpress 4.5.3 and 4.6.

Attachments (1)

Edytuj_wpis_‹_Szkoła_Podstawowa_nr_13_—_WordPress__2016-08-27_21-21-46.png (41.9 KB) - added by cezariuszmarek 8 years ago.

Download all attachments as: .zip

Change History (6)

#1 @swissspidy
8 years ago

Hey there,

Thanks for your report. Just to repeat, this happens on 4.6 as well as 4.5? And your image is being uploaded but there are no thumbnails, correct?

If so, this could be a duplicate of #36534, where eventually the conclusion was that it's caused by a server misconfiguration.

#2 @cezariuszmarek
8 years ago

Just to repeat, this happens on 4.6 as well as 4.5?

Yes. I started with 4.5.3 and I had this error several times. Then I upgraded to 4.6 and the error is still there. Note it's completely random, and reuploading the same image usually works (not always though).

And your image is being uploaded but there are no thumbnails, correct?

Sort of. Not only the image doesn't have a thumbnail, but the file isn't visible at all at the list of images attached to the post until I put the filename into the search box.

Ticket #36534 doesn't have a solution, so it's hard to tell if it's a duplicate. I've tried to limit the Imagick thread count to 1 (and I confirmed it with "echo Imagick::getResourceLimit(6)"), but it didn't help.

I could even live with the error if it didn't leave garbage in the database and file system.

#3 @cezariuszmarek
8 years ago

Can I turn on some kind of an error logging to see what is the reason of the error? I've raised max_execution_time to 300, but it didn't help either. This error is so annoying, because less advanced users leave trash in the database or ask me why some images don't appear.

#4 @joemcgill
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi @cezariuszmarek, I also suspect this is a duplicate of #36534. Generally, what's happening in these cases is that the PHP process is encountering a fatal error during the process of processing the uploaded images. Since the error is probably happening in the image processing library, PHP is not able to recover. Unfortunately, there are many different reasons this error might occur, which is why the other ticket has not been resolved. There may be some information in your server's error logs that may help.

In the mean time, I'm going to go ahead and close this ticket as a duplicate, but feel free to keep the conversation going here or over on the other ticket if you prefer.

#5 @cezariuszmarek
8 years ago

Since the error is probably happening in the image processing library, PHP is not able to recover

I don't know PHP, but isn't it possible to try-catch the error? And it you are able to display the "HTTP error" message, why can't you remove garbage from the database at the same time?

Note: See TracTickets for help on using tickets.